users@glassfish.java.net

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

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Mon, 18 May 2009 15:28:44 -0700

Hi Markus,

You might also need to set property "eclipselink.target-server" to "SunAS9" if
that version of GF doesn't have EclipseLink integration.

Regards,
-marina

Markus Karg wrote:
> 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
>