users@glassfish.java.net

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

From: Markus Karg <karg_at_quipsy.de>
Date: Tue, 19 May 2009 12:05:57 +0200

Marina,

thank you for that tip. Yes this solves the problem. Actually I thought
JPA is a standard interface so there is no need for vendor specific
tweaks to be done. Strange.

I updated the WIKI to reflect this essential detail (and some other
more):

http://wiki.glassfish.java.net/Wiki.jsp?page=FaqEclipseLinkGlassFishV2

Thanks
Markus

> -----Original Message-----
> 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
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net