← Back to team overview

maria-discuss team mailing list archive

Re: Copying database files

 

> Am 13.08.2018 um 12:22 schrieb Ling, Andy:
> >> "The advantage of FLUSH TABLES table_name FOR EXPORT is that the
> table
> >> is read locked until UNLOCK TABLES is executed" is not really true
> >> because that's only valid for the running connection
> >
> > Surely not. If you've locked a table for read only nothing should be able to
> write to it from any connection otherwise what's the point of a multi-
> threaded server? Tests suggest otherwise.
> 
> "Another item to be aware of with this statement is that the read lock
> is released as soon as the session that made the call ends. When the
> pre-freeze-script finishes, the session is closed" - try it out
> 
> and how do you make a script that locks the table and continues without
> closing the session to mysqld?
> 

This is being driven by a Java program. It opens a connection using the mariadb-java-client. That connection isn't released until the end of the copying process when the tables are unlocked and then it only goes back into a pool, so may not be closed at all.

Regards

Andy Ling


**********************************************************************
DISCLAIMER:
Privileged and/or Confidential information may be contained in this message. If you are not the addressee of this message, you may not copy, use or deliver this message to anyone. In such event, you should destroy the message and kindly notify the sender by reply e-mail. It is understood that opinions or conclusions that do not relate to the official business of the company are neither given nor endorsed by the company. Thank You.


References