apph | 16 Apr 22:43 2014

openjpa.jdbc.Schemas configuration property

According to the documentation:
This property accepts a comma-separated list of schemas and tables

However, when I'm trying to specify two schemas in the form like <property
name="openjpa.jdbc.Schema" value="SCHEMA1,SCHEMA2"/> i do not get any
results. When I specify only one I'm getting the generated entities.
I'm using Oracle database and

I was checking the source code and I don't know how it can work as it goes
down to this class:
oracle.jdbc.driver.OracleDatabaseMetaData and there is this comparison:
WHERE t.owner LIKE :1 where :1 is the passed schema value, so
"SCHEMA1,SCHEMA2". The values in the owner column are particular schema

View this message in context:
Sent from the OpenJPA Users mailing list archive at

apph | 16 Apr 22:49 2014

Reversemappingtooltask with oracle fails

I'm using this command: java org.apache.openjpa.jdbc.meta.ReverseMappingTool
-d src schema.xml with oracle database. I've found that there is a known bug
OPENJPA-2022 which is supposed to be fixed in the trunk. I've taken the
source code, built the jars from trunk but still got this error. I've have
the changed code from the patch in this bug in my library: 
schemaName = DBIdentifier.trimToNull(pks[i].getSchemaIdentifier());

Is it really fixed? Or am I doing something wrong?

View this message in context:
Sent from the OpenJPA Users mailing list archive at

mxvs | 8 Apr 09:59 2014

Re: OpenJPA retrieving one column a seperate select

Hello Rick,

Were you able to download my Unit Test and make sense of what might be going


View this message in context:
Sent from the OpenJPA Users mailing list archive at

mxvs | 28 Mar 12:10 2014

Re: OpenJPA retrieving one column a seperate select

Hello Rick,

I've put together a test class and required entities as part of a .zip
attachment to this mail. I did not manage to re-create the problem of the
Blob column being retrieved in a separate select (as is still happening on
with my system) however I was able to get the same effect when retrieving an
entity relationship, which is also being done in N+1 selects (same issue as
with the column above). The issue does not occur when using a fetch call
instead of a join, as also shown in the test case. 

Everything is performed on the 2.1.2-SNAPSHOT branch.

In the test case are two test methods. The first one will retrieve the
relationship by calling .join() on the query root. The second case retrieves
the relationship using .fetch(). 

In case of the .join() call the second entitiy is being retrieved one at the
time, resulting in N+1 queries. Which leads to about 10x worse performance
in my real world code.

Join<LogischRapport, Raptaalmetadata> raptaalmetadata =

*I get the following initial SQL:*

1847  test  TRACE  [main] openjpa.jdbc.SQL - <t 1195394880, conn 670181362>
executing prepstmnt 1790667451 SELECT t0.rapportnr, t0.rapporttype,, t0.BATCH_NBR_HITS, t0.BATCH_RF_CODE, t0.BO_REPORT_TYPE_ID,
t0.dca, t0.DEFAULT_PRIORITY_ID, t0.EXTERN_RAPPORT_FLAG, t0.geschrapt,
(Continue reading)

Henno Vermeulen | 26 Mar 15:59 2014

Java 8 support

Yesterday Java 8 was officially released. When I try to compile and run my tests and application that use
OpenJPA 2.3.0 with Java 8 I get errors (see below) when I try to enhance the entities or use the java agent.
Are there plans to support Java 8 in the near future?

I did find the following issue which was unfortunately last updated almost half a year ago:

Henno Vermeulen

Java agent:

431  olgaPersistenceUnit  WARN   [main] openjpa.Enhance - An exception was thrown while attempting to
perform class file transformation on "nl/hm/olga/core/entity/AbstractEntity":java.lang.IllegalArgumentException
                at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
                at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
                at org.apache.xbean.asm4.ClassReader.<init>(Unknown Source)
                at org.apache.openjpa.enhance.AsmAdaptor.toJava7ByteArray(
                at org.apache.openjpa.enhance.AsmAdaptor.toByteArray(
                at org.apache.openjpa.enhance.PCClassFileTransformer.transform0(
                at org.apache.openjpa.enhance.PCClassFileTransformer.transform(
                at sun.instrument.TransformerManager.transform(
                at sun.instrument.InstrumentationImpl.transform(
                at java.lang.ClassLoader.defineClass1(Native Method)
                at java.lang.ClassLoader.defineClass(
                at Method)
(Continue reading)

mxvs | 25 Mar 19:51 2014

OpenJPA retrieving one column a seperate select

Hello, I've been using OpenJPA 2.1.2 (JPA 2.0) to retrieve data from a table
called LOGISCHRAPPORT which has about 28 columns. In some cases OpenJPA
decides to issue seperate select statements for one of the columns for no
particular reason, leading to a dramatic decrease in query performance.

Initially everything goes fine and all my columns are retrieved in a
performant, single SELECT statement by JPA.

As soon as I add a relationship to another entity called RAPTAALMETADATA

 <at> OneToMany(fetch=FetchType.EAGER, cascade = CascadeType.ALL)
 <at> JoinColumns({
         <at> JoinColumn(name = "RAPPORTNR", referencedColumnName = "RAPPORTNR"),
         <at> JoinColumn(name = "RAPPORTTYPE", referencedColumnName =
private List<Raptaalmetadata> raptaalmetadata;
Queried using Criteria API as follows:
Join<LogischRapport, Raptaalmetadata> metadata = reportRoot.join(

JPA no longer includes one of my original columns called REPORT_COMMENTS
instead it is issuing separate select statements to retrieve the
REPORT_COMMENTS column for each instance of LOGISCHRAPPORT. All other
columns (including the ones coming from RAPTAALMETADATA are retrieved
properly as part of the intial SELECT.

REPORT_COMMENTS is of the HUGEBLOB type in Oracle and I've mapped in in my
Entity as follows:
(Continue reading)

Vito | 24 Mar 16:56 2014

Confusing conflicts between OpenJPA and Postgresql

Hi all,
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:
17:32:05,155 ERROR [ProcessStoreImpl] Error persisting deployment record for
{}longFlow-1; process will not be available after restart!
<openjpa-1.2.1-r752877:753278 nonfatal general error>
org.apache.openjpa.persistence.PersistenceException: Cannot change transaction isolation level
in the middle of a transaction
    at org.apache.openjpa.jdbc.sql.DBDictionary.narrow(
    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection(
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(
    at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(
(Continue reading)

Alain Brazeau | 23 Mar 00:53 2014

Unecessary database update?

My application has the following bidirectional one-to-many association:

 <at> Entity
 <at> Table(name="TB_CUSTOMERS")
public class Customer {

     <at> OneToMany(mappedBy="customer", cascade={CascadeType.PERSIST,
     <at> OrderBy("createdDate DESC")
    private List<Order> orders = new ArrayList<Order>();



 <at> Entity
 <at> Table(name="TB_ORDERS")
public class Order {

     <at> ManyToOne
     <at> JoinColumn(name="CUSTOMER_ID")
    private Customer customer;



I recently noticed that when a new Order object is added to a Customer
object's Order List, the underlying Customer database table record gets
updated, even though the Customer object was not modified.  This is
(Continue reading)

Joe_DAMS | 19 Mar 15:03 2014

The id class specified by type does not match the primary key fields of the class

Hello everybody !
I am faced a migrate project problem. I've got a very very very old java ee
project that currently runs on jboss 4 server. I'm trying to migrate it on a
fresh apache tomee installation.

Entity classes was coded like this:

PK class

Box class

Actually this is works on the jboss 4 server installation but when i'm
trying to start it on apache tomee I got the following error :

I need to keep the  <at> ManyToOne relation inside the PK class. Does someone
know an issue in order to help me ?

Tanks a lot :)

View this message in context:
Sent from the OpenJPA Users mailing list archive at

Todd Nine | 19 Mar 06:10 2014

Using a time UUID as a sequence

Hi all,
 We're migrating from a Key/Value system to MySQL for some components of
our system for easier administration and maintenance.  As part of this
migration, we need to retain the time UUIDs that have been generated for
primary keys.  I'm having a hard time mapping this.  I have the following.

 <at> Id
 <at> Column( columnDefinition = "BINARY(16)", length = 16 )
private UUID id;

However this always seems to fail.  I'm on the latest MySQL version 5.6.16
GA and Open JPA 2.2.2 I've found this old thread, but it's not quite what
I'm looking for.  I'm really struggling to find the documentation on how to
declare and implement custom type converters. Converting a UUID to a binary
array of length 16 is trivial, as is creating a new UUID instance from
those bytes.  I'm just not sure how to plug in to the JPA framework to make
it happen.  Any advice would be greatly appreciated.

Haim Schneider | 13 Mar 13:59 2014

MySQLNonTransientConnectionException: Can't call rollback when autocommit=true

Automatic table generation fails with MySQL. I get the exception:

MySQLNonTransientConnectionException: Can't call rollback when 

This exception causes the connection to be closed, and the automatic table 
generation fails.

The exception is thrown by the SchemaTool.executeSQL method. I checked the 
source code and found that the method calls rollback prior to executing 
the SQL statement. The problem is that the method also set autocommit to 
true before calling rollback, and this leads to the 
MySQLNonTransientConnectionException that causes the connection to be 

Is there any workaround?

The complete exception is: 

Can't call rollback when autocommit=true
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
        at java.lang.reflect.Constructor.newInstance(
        at com.mysql.jdbc.Util.handleNewInstance(
        at com.mysql.jdbc.Util.getInstance(
(Continue reading)