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: Wed, 20 May 2009 11:48:17 -0700

target-server setting makes a difference if GF code doesn't set it for you when
creating container EMF. AFAIK in v2.1 the GF code is there.

Check if you don't need to call em.joinTransaction() (in case you are creating
EM yourself).

Regards,
-marina

Phillip Ross wrote:
> I tried placing the target-server property in the persistence.xml as Marina suggested but unfortunately that didnt solve the problem I experience :(
>
> I do know that I dont need any property explicitly with eclipselink v1.0.2 which is currently my environment where everything works. I just need to have the eclipselink.jar in the domain lib dir, specify the provider class in the persistence.xml and everything just works.
>
> - Phillip
>
>
>
> ----- Original Message ----
>
>>From: Markus Karg <karg_at_quipsy.de>
>>To: users_at_glassfish.dev.java.net
>>Cc: Tom Ware <tom.ware_at_oracle.com>
>>Sent: Tuesday, May 19, 2009 6:05:57 AM
>>Subject: RE: Re: EclipseLink 1.1.1 in GlassFish v2ur2 does never INSERT anything...!
>>
>>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:
>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>org.eclipse.persistence.jpa.PersistenceProvider
>>>
>>>> jdbc/YYY
>>>>
>>>>
>>>>
>>>>
>>>>
>>
>>value="org.eclipse.persistence.platform.database.SQLAnywherePlatform"
>>
>>>/>
>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>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
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>>For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>