db4o 7.4

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
 boolean isAlive()
          checks if the client is currently connected to a server.
 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
activate, backup, bind, collections, configure, deactivate, descend, getByID, getByUUID, getID, getObjectInfo, identity, isActive, isCached, isClosed, isStored, knownClasses, lock, migrateFrom, peekPersisted, purge, purge, reflector, refresh, releaseSemaphore, replicationBegin, set, setSemaphore, store, storedClass, storedClasses, systemInfo, version
 
Methods inherited from interface com.db4o.ObjectContainer
activate, close, commit, deactivate, delete, ext, get, query, query, query, query, query, queryByExample, rollback, set, store
 

Method Detail

switchToFile

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

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.


isAlive

boolean isAlive()
checks if the client is currently connected to a server.

Returns:
true if the client is alive.

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.