db4o 2.5

com.db4o.ext
Interface ExtClient

All Superinterfaces:
ExtObjectContainer, ObjectContainer

public interface ExtClient
extends ExtObjectContainer

extended client functionality for the ExtObjectContainer interface.

Both Db4o.openClient() methods always return an ExtClient object so a cast is possible.

The ObjectContainer functionality is split into multiple interfaces to allow newcomers to focus on the essential methods.


Method Summary
 void switchToFile(java.lang.String fileName)
          requests opening a different server database file for this client session.
 void switchToMainFile()
          requests switching back to the main database file after a previous call to switchToFile(String fileName).
 
Methods inherited from interface com.db4o.ext.ExtObjectContainer
bind, configure, getByID, getID, isActive, isCached, isClosed, isStored, purge, purge, storedClass, storedClasses
 
Methods inherited from interface com.db4o.ObjectContainer
activate, close, commit, deactivate, delete, ext, get, query, rollback, set
 

Method Detail

switchToFile

public void switchToFile(java.lang.String fileName)
requests opening a different server database file for this client session.

This method can be used to switch between database files from the client side while not having to open a new socket connection or closing the current one.

If the database file does not exist on the server, it will be created.

A typical usecase:
The main database file is used for login, user and rights management only. Only one single db4o server session needs to be run. Multiple satellite database files are used for different applications or multiple user circles. Storing the data to multiple database files has the following advantages:
- easier rights management
- easier backup
- possible later load balancing to multiple servers
- better performance of smaller individual database files
- special debugging database files can be used

User authorization to the alternative database file will not be checked.

All persistent references to objects that are currently in memory are discarded during the switching process.

Parameters:
fileName - the fully qualified path of the requested database file.

switchToMainFile

public void switchToMainFile()
requests switching back to the main database file after a previous call to switchToFile(String fileName).

All persistent references to objects that are currently in memory are discarded during the switching process.


db4o 2.5