Hi,

Alessandro Colantoni wrote:
Hi Change are really written to the database.
I get an error of MsSQLServer.



in this case I assume that the problem wasn't caused by OJB, because between PB.beginTransaction() and PB.commitTransaction() it's guaranteed that OJB use the same connection.
If you only do
>>>broker.beginTransaction();
>>>broker.store(storeVO);
>>>broker.commitTransaction();
and an exception occur, all changes will be discarded on PB.abortTransaction.


Except you don't let OJB change the autoCommit state of the connection.
http://db.apache.org/ojb/docu/guides/repository.html#useAutoCommit

Are you sure that only one PB was used the perform your objects?

regards,
Armin


On 4/19/05, Armin Waibel <[EMAIL PROTECTED]> wrote:


Hi,

are the changes really writen to database or is it a caching issue?

regards,
Armin

Alessandro Colantoni wrote:

Hi all!.
In a mehod i have the following to store a vale object :
try{
broker = ServiceLocator.getInstance().findBroker();
broker.beginTransaction();
broker.store(storeVO);
broker.commitTransaction();
} catch (PersistenceBrokerException e) {
if (broker!=null) broker.abortTransaction();
} finally {
if (broker != null) broker.close();
}
storeVO has collection references with autoupdate = true in

repository.xml.

When I execute the method if there are errors in collection store (for
example some field of wrong type) I catch the PersistenceBrokerException

but

the storeVO object is stored as well. Rollback doesn't take place, as if
storeVO and collection references were not in the same transaction.
I want that if there is an error storing an element of the collection
reference all transaction abort so that nothing should be stored.
How have I to do?
thanks in advance...


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





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



Reply via email to