Hi, > Currently we lock the MySql DB before taking backup with FLUSH TABLES WITH > READ LOCK, which closes all open tables and locks all tables for all > databases with a read lock until you explicitly release the lock by executing > UNLOCK TABLES. > > Can we guarantee that while we have this lock in the DB, JackRabbit will not > update the local index files, even if the application tries to save something > in the repository? If so we could use that lock to safely copy as well the > local indexing (which would be in sync with the DB)
I don't know how this MySQL feature works exactly. The MySQL persistence managers (bundle and non-bundle) of Jackrabbit use regular "insert", "update" and "delete" statements (see BundleDbPersistenceManager.buildSQLStatements()). If those are blocked by the FLUSH TABLES statement, then there is no problem. To verify that, you probably have consult the MySQL documentation or ask MySQL experts. > If so we could use that lock to safely copy as well the local indexing (which > would be in sync with the DB) As far as I know there are cases where the Lucene index is written after the data is inserted in the persistence manager. I don't know the details, but it's probably save if you lock the tables, but then wait for some time until you copy the Lucene index files (a few seconds) to make sure the changes before locking are written. Regards, Thomas
