hello everybody,

we do a jboss project and we use the persistence broker only.
therefore we use the PersistenceBrokerFactorySyncImpl, which is recommend to use with managed environments and pb only.
we don't use entity beans. we have a stateless OjbSessionBean, which is called for any db activities.



here comes the problem:


if an error occurs in a sequence of n inserts/updates/deletes I want to rollback the whole thing. When I have a look at my spy.log, there is always a commit at the end of the log (and no rollback), even if ojb throws an exception because of that error.
because it's not allowed to use broker.beginTransaction in my code, I can't to anything to mark/abort/commit my transaction.


I had a look at the faq, so I know I could do it like that:

Transaction tx = odmg.newTransaction(); tx.begin();
PersistenceBroker broker = ((HasBroker) tx).getBroker();
....
broker.dothisanddothat();
..
tx.commit();

my questions are:
1.) is this the recommend way, if I want to use transactions with my pk?
if yes: can I still use PersistenceBrokerFactorySyncImpl or do i have to switch back to PersistenceBrokerFactoryDefaultImpl.(because of odmg)


2.) how do I have to set the the xdoclet tag 'transaction' to use normal broker.beginTransaction() and do not let jboss do the transactions?
are there any drawbacks if I do so?


thanks for any advice!!
andreas









--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to