| org.apache.ojb.ejb.odmg.ODMGBaseBeanImpl org.apache.ojb.ejb.odmg.RollbackBean
RollbackBean | public class RollbackBean extends ODMGBaseBeanImpl implements SessionBean(Code) | | 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);
// ... 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: RollbackBean.java,v 1.1.2.4 2005/12/21 22:21:39 tomdz Exp $ |
RollbackBean | public RollbackBean()(Code) | | |
deleteObjects | public void deleteObjects(List objects)(Code) | | |
getArticleCount | public int getArticleCount()(Code) | | |
getObjectCount | protected int getObjectCount(Class target)(Code) | | |
getPersonCount | public int getPersonCount()(Code) | | |
rollbackBreakIteration | public void rollbackBreakIteration(List objectsToStore)(Code) | | We use several OJB services, start to iterate a query result and do
an odmg-tx.abort call.
|
rollbackClientWrongInput | public void rollbackClientWrongInput(List articles, List persons)(Code) | | This test method expect an invalid object in the person list,
so that OJB cause an internal error.
|
rollbackOdmgAbort | public void rollbackOdmgAbort(List objects)(Code) | | We do an odmg-tx.abort() call.
|
rollbackOtherBeanUsing | public void rollbackOtherBeanUsing(List articles, List persons)(Code) | | First stores all articles, persons form
the lists using ArticleManager and PersonManager
beans after doing that, a Exception will be thrown.
|
rollbackOtherBeanUsing_2 | public void rollbackOtherBeanUsing_2(ArticleVO article, List persons)(Code) | | First store a list of persons then we
store the article using a failure store
method in ArticleManager.
|
rollbackPassInvalidObject | public void rollbackPassInvalidObject(List objects)(Code) | | One of the objects passed by the client will cause an exception.
|
rollbackSetRollbackAndThrowException | public void rollbackSetRollbackAndThrowException(List objects)(Code) | | We do call ctx.setRollbackOnly and do odmg-tx.abort() call.
|
rollbackSetRollbackOnly | public void rollbackSetRollbackOnly(List objects)(Code) | | We do call ctx.setRollbackOnly and do odmg-tx.abort() call.
|
rollbackThrowException | public void rollbackThrowException(List objects)(Code) | | The bean will throw an exception before the method ends.
|
|
|