com.db4o.ext
Class ExtDb4o
java.lang.Object
|
+--com.db4o.Db4o
|
+--com.db4o.ext.ExtDb4o
- public final class ExtDb4o
- extends Db4o
extended factory class with static methods to open special db4o sessions.
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
objectContainer
public static ObjectContainer objectContainer(javax.servlet.ServletContext context,
javax.servlet.http.HttpSession session,
java.lang.String file)
- returns an
ObjectContainer
to be used in a stateless
servlet session.
db4o internally takes care of all issues:
- returning the same ObjectContainer instance for every call with the
same session parameter
- closing the ObjectContainer upon session termination
- closing the ObjectContainer upon shutdown
- closing and reopening the ObjectContainer in case servlet classes were
exchanged and multiple ClassLoader namespaces exist.
- Parameters:
context
- the current ServletContextsession
- the current HttpSessionfile
- the db4o database file to be used
openMemoryFile
public static final ObjectContainer openMemoryFile(MemoryFile memoryFile)
- opens an
ObjectContainer
for in-memory use .
In-memory ObjectContainers are useful for maximum performance
on small databases, for swapping objects or for storing db4o format data
to other media or other databases.
Be aware of the danger of running
into OutOfMemory problems or complete loss of all data, in case of hardware
or JVM failures.
- Parameters:
memoryFile
- a MemoryFile
to store the raw byte data.- Returns:
- an open
ObjectContainer
- See Also:
MemoryFile
use
public static final ObjectContainer use(java.lang.Object jNLPRandomAccessFile)
-
Java Web Start interface to open an
ObjectContainer
on a JNLPRandomAccessFile.
Make sure the JNLPRandomAccessFile is opened for readwrite access and that
sufficient filespace is reserved with FileContents.setMaxLength().
This feature is only available in db4o professional edition.
- Parameters:
jNLPRandomAccessFile
- a javax.jnlp.JNLPRandomAccessFile, typically opened with
javax.jnlp.FileContents.getRandomAccessFile("rw");- Returns:
- an open
ObjectContainer