db4o |

# Configuration.lockDatabaseFile Method

can be used to turn the database file locking thread off.

void lockDatabaseFile(
bool flag
);

#### Parameters

flag

      false

  to turn database file locking off.

#### Remarks

can be used to turn the database file locking thread off.
Since Java does not support file locking up to JDK 1.4, db4o uses an additional thread per open database file to prohibit concurrent access to the same database file by different db4o sessions in different VMs.
To improve performance and to lower ressource consumption, this method provides the possibility to prevent the locking thread from being started.
Caution!
If database file locking is turned off, concurrent write access to the same database file from different JVM sessions will corrupt the database file immediately.
This method has no effect on open ObjectContainers. It will only affect how ObjectContainers are opened.
The default setting is

    true

.

#### See Also

Configuration Interface | com.db4o.config Namespace