users@glassfish.java.net

EclipseLink 1.1.1 in GlassFish v2ur2 does never INSERT anything...!

From: Markus Karg <karg_at_quipsy.de>
Date: Mon, 18 May 2009 16:58:05 +0200

My application works well on GlassFish v2ur2 using the contained TopLink
product.

 

Now I switched from TopLink to EclipseLink 1.1.1 by putting
eclipselink.jar into domain1/lib, and setting the provider and platform
explicitly in persistence.xml of my EJB-JAR module inside of my EAR
module:

 

<persistence-unit name="XXX">

  <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

  <jta-data-source>jdbc/YYY</jta-data-source>

  <properties>

    <property name="eclipselink.target-database"
value="org.eclipse.persistence.platform.database.SQLAnywherePlatform" />

    </properties>

  </persistence-unit>

</persistence>

 

I can still read all data, but newly created data is never found in the
database. Inspecting the LOG discovers that EclipseLink never did
execute any InsertObjectQuery, so it did never INSERT the data into the
database, but it DID recognize that the PERSIST operation was called
("PERSIST operation called" is in the log, but no "Execute query
InsertObjectQuery" is found).

 

This is really weird! If I do the same inside of a standalone Java SE
sample with the same database, driver and eclipselink version, it is
working pretty well! So it must be caused by the relation to the
GlassFish v2ur2 container.

 

If I remove the em.getTransaction().commit() from the Java SE sample,
then it is exactly the same log result as the server log shows. So I
expect that GlassFish is not closing the transaction OR the persistence
provider does not recognize that. This would explain, why there is no
"commit transaction" found in the server.log at all!

 

Since my application solely uses container managed transaction and NEVER
uses the transaction API directly, I suppose this to be a bug either in
GlassFish v2ur2 or in EclipseLink 1.1.1 (or in the description how to
integrate it).

 

Can anybody explain why this happens, and what to do against it? I am
really desperate!

 

Thanks

Markus