You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Efftinge, Sven" <SE...@lohndirekt.de> on 2002/12/13 13:53:00 UTC

[PB] abortTransaction()

Hi,
I've a problem with the transactions:
When I run this...
	ProduktIF p = new Produkt();
	p.setDatum(new Datum());

	try {
		broker.beginTransaction();
		broker.store(p);
		broker.abortTransaction();
	} catch (PersistenceBrokerException ex) {
		ex.printStackTrace();
	}

...there is always a new Produkt in the database.
But on an abort the db should be rolled back to the state it had before
begin(), am I right? 
So, is this a normal behaviour for PersistenceBroker?
I'm using postgresql 7.2 with jdbcdriver 7.3 and I'm using jdbcLevel 3.
I've tested the driver , and the transactions behave as I expected.

Any Ideas?
Sven

Re: [PB] abortTransaction()

Posted by Armin Waibel <ar...@code-au-lait.de>.
Hi Sven,

----- Original Message -----
From: "Efftinge, Sven" <SE...@lohndirekt.de>
To: "'OJB Users List'" <oj...@jakarta.apache.org>
Sent: Friday, December 13, 2002 1:53 PM
Subject: [PB] abortTransaction()


> Hi,
> I've a problem with the transactions:
> When I run this...
> ProduktIF p = new Produkt();
> p.setDatum(new Datum());
>
> try {
> broker.beginTransaction();
> broker.store(p);
> broker.abortTransaction();
> } catch (PersistenceBrokerException ex) {
> ex.printStackTrace();
> }
>
> ...there is always a new Produkt in the database.
> But on an abort the db should be rolled back to the state it had
before
> begin(), am I right?
> So, is this a normal behaviour for PersistenceBroker?

Definitely not. But I think this problem is not not caused by PB, there
are several
test cases testing rollback behaviour.
Do you change the OJB.properties settings?
Do you set useAutoCommit=0 in OJB.properties file? Try '1'
Set eager-release=true in jdbc-connection-descriptor? Set false, or
remove entry.
Do you use Datasources or Connections from OJB pool?

regards,
Armin


> I'm using postgresql 7.2 with jdbcdriver 7.3 and I'm using jdbcLevel
3.
> I've tested the driver , and the transactions behave as I expected.
>
> Any Ideas?
> Sven
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>
>