| This is an session bean implementation using odmg implementation.
For more structured implementations take a look at
org.apache.ojb.ejb.SessionBeanImpl
org.apache.ojb.ejb.odmg.ODMGBaseBeanImpl
org.apache.ojb.ejb.pb.PBBaseBeanImpl
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);
// ... do something
-
Obtain the current odmg-Transaction from the Implementation instance
to lock objects - Attend that there must be already a Database opened before.
Transaction tx = odmg.currentTransaction();
tx.lock(aObject, mode);
author: Armin Waibel version: $Id: ODMGSessionBean.java,v 1.5.2.4 2005/12/21 22:21:39 tomdz Exp $ |