Re: Confusing conflicts between OpenJPA and Postgresql - Mailing list pgsql-general

From Albe Laurenz
Subject Re: Confusing conflicts between OpenJPA and Postgresql
Date
Msg-id A737B7A37273E048B164557ADEF4A58B17CE7D14@ntex2010i.host.magwien.gv.at
Whole thread Raw
In response to Confusing conflicts between OpenJPA and Postgresql  (Vito <testforvln@163.com>)
List pgsql-general
Vito wrote:
> I'm recently doing some research with Apache ODE engine. I use Postgresql as its external database,
> openjpa as its ORM solution and bitronix as its transaction manager. The ODE workflow engine starts
> without any problem. But when I deploy process definition files into the engine, the exception came
> out. I paste the error content at the end of this email.
> I looked through the source code of org.apache.openjpa.lib.jdbc.DecoratingDataSource, and found that
> openjpa is almost definitely to meant to invoke the function of reseting transaction isolation level,
> which would be catched by Postgresql and return with an exception.
> Does that mean openjpa works poorly with Postgresql? Or who can tell me how to solve this problem.

> The error content is below:

> org.apache.openjpa.persistence.PersistenceException: Cannot change transaction isolation level in the
> middle of a transaction

> Caused by: org.postgresql.util.PSQLException: Cannot change transaction isolation level in the middle
> of a transaction

That makes sense, doesn't it?
I don't think there is any database that would allow to change the isolation level
in the middle of a transaction.

I tested with Oracle:

SELECT ....

SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
ERROR at line 1:
ORA-01453: SET TRANSACTION must be first statement of transaction

I think you will have to make sure that the SET TRANSACTION ISOLATION LEVEL
statement is the first statement issued in the transaction.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Álvaro Nunes Lemos Melo
Date:
Subject: Re: Upgrading from 9.2 to 9.3 causes performance degradation
Next
From: Adrian Klaver
Date:
Subject: Re: Upgrading from 9.2 to 9.3 causes performance degradation