How to use ODMG
To keep this example as simple as possible, we lookup a static OJB ODMG implementation instance
on each bean instance.
But it's recommended to bind an instance of the Implementation class in JNDI
(at appServer start), open the database and lookup this instances via JNDI in
ejbCreate().
To use the odmg-api within your bean, you can do:
Obtain the current Database from the Implementation instance - Attend
that there must be already a Database opened before.
db = odmg.getDatabase(null);
// ...
This is an session bean implementation used for testing different "rollback"
scenarios for the ODMG implementation.
How to use ODMG
To keep this example as simple as possible, we lookup a static OJB ODMG implementation instance
on each bean instance.
But it's recommended to bind an instance of the Implementation class in JNDI
(at appServer start), open the database and lookup this instances via JNDI in
ejbCreate().
However the examples use a simple helper class to lookup the OJB resources.
To use the odmg-api within your bean, you can do:
Obtain the current Database from the Implementation instance - Attend
that there must be already a Database opened before.
db = odmg.getDatabase(null);
// ...