apph | 16 Apr 22:43 2014
Picon

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
org.apache.openjpa.jdbc.meta.ReverseMappingTool.

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
values: SYSTEM, SCHEMA1, SYSTEM, SCHEMA2, SCHEMA3, etc....

--
View this message in context: http://openjpa.208410.n2.nabble.com/openjpa-jdbc-Schemas-configuration-property-tp7586236.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

apph | 16 Apr 22:49 2014
Picon

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: http://openjpa.208410.n2.nabble.com/Reversemappingtooltask-with-oracle-fails-tp7586237.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

mxvs | 8 Apr 09:59 2014
Picon

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
on?

Thanks
Max

--
View this message in context: http://openjpa.208410.n2.nabble.com/OpenJPA-retrieving-one-column-with-a-seperate-select-tp7586156p7586194.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

mxvs | 28 Mar 12:10 2014
Picon

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 =
reportRoot.join("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.author, t0.BATCH_NBR_HITS, t0.BATCH_RF_CODE, t0.BO_REPORT_TYPE_ID,
t0.BURSTING_MODE, t0.comments, t0.DATUM_CREATIE, t0.DATUM_LAATSTE_WIJZIGING,
t0.dca, t0.DEFAULT_PRIORITY_ID, t0.EXTERN_RAPPORT_FLAG, t0.geschrapt,
(Continue reading)

Henno Vermeulen | 26 Mar 15:59 2014
Picon

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: https://issues.apache.org/jira/browse/OPENJPA-2386

Regards,
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(AsmAdaptor.java:93)
                at org.apache.openjpa.enhance.AsmAdaptor.toByteArray(AsmAdaptor.java:78)
                at org.apache.openjpa.enhance.PCClassFileTransformer.transform0(PCClassFileTransformer.java:156)
                at org.apache.openjpa.enhance.PCClassFileTransformer.transform(PCClassFileTransformer.java:126)
                at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
                at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
                at java.lang.ClassLoader.defineClass1(Native Method)
                at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
                at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
                at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
                at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
                at java.security.AccessController.doPrivileged(Native Method)
(Continue reading)

mxvs | 25 Mar 19:51 2014
Picon

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 =
"RAPPORTTYPE") })
private List<Raptaalmetadata> raptaalmetadata;
--- 
Queried using Criteria API as follows:
---
Join<LogischRapport, Raptaalmetadata> metadata = reportRoot.join(
    "raptaalmetadata");

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
{http://sample.bpel.org/bpel/sample}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(DBDictionary.java:4232)
    at org.apache.openjpa.jdbc.sql.DBDictionary.newStoreException(DBDictionary.java:4197)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:102)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:88)
    at org.apache.openjpa.jdbc.sql.SQLExceptions.getStore(SQLExceptions.java:64)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.connect(JDBCStoreManager.java:930)
    at org.apache.openjpa.jdbc.kernel.JDBCStoreManager.getConnection(JDBCStoreManager.java:230)
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:371)
    at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:339)
    at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:420)
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
    at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:206)
    at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
(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,
CascadeType.REMOVE})
     <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
Picon

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: http://openjpa.208410.n2.nabble.com/The-id-class-specified-by-type-does-not-match-the-primary-key-fields-of-the-class-tp7586109.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

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.

Thanks,
Todd
Haim Schneider | 13 Mar 13:59 2014
Picon

MySQLNonTransientConnectionException: Can't call rollback when autocommit=true

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

MySQLNonTransientConnectionException: Can't call rollback when 
autocommit=true

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 
closed.

Is there any workaround?

The complete exception is: 

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: 
Can't call rollback when autocommit=true
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
(Continue reading)


Gmane