Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink 2 and JPA 2.0
EclipseLink 2 and JPA 2.0 [message #503644] Tue, 15 December 2009 07:47 Go to next message
Brendan Haverlock is currently offline Brendan HaverlockFriend
Messages: 46
Registered: July 2009
Member
Hi all,

I have a few questions for you:

1. I am using GlassFish V2.1. I am able to launch my application with the EclipseLink 2.0 and JPA 2.0 jars. I can't tell if it is just using the 1.0 JPA interfaces instead of using JPA 2.0. I also can't change my persistence.xml file to have persistence="2.0" without it erroing. Is JPA 2.0 compatible with GlassFish 2.X?

2. I heard orphan deletion was handled automatically by JPA 2.0. Is this true? E.g. I have classes Foo and Bar. Foo has a list of Bar's and Bar has a list of Foo's. These are annotated as ManyToMany's. If I delete a Bar from Foo's list of Bar's, will Foo be removed from the corresponding list of Foo's in that Bar?

Thank you,
-Brendan
Re: EclipseLink 2 and JPA 2.0 [message #503773 is a reply to message #503644] Tue, 15 December 2009 12:12 Go to previous messageGo to next message
Michael OBrien is currently offline Michael OBrienFriend
Messages: 34
Registered: July 2009
Member
Brendan,
Hi, I'll answer #1 - yes you should be alright running JPA 2.0 API on Glassfish V2.1 - however tthere is an issue with specifying JPA 2.0 tags like
<shared-cache-mode>NONE</shared-cache-mode>

in your persistence.xml via the header

<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

I will be currently triaging this problem shortly, you can track the issue on the JPA 2.0 migration page for Glassfish V3/V2 in the 10th column of the results table in

http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/glas sfish

We get the following deployment error when using the 2.0 XSD only on Glassfish V2.1
deploy:
[exec] CLI171 Command deploy failed : Deploying application in domain failed; Error loading deployment descriptors for module [org.eclipse.persistence.example.jpa.server.glassfishv2.Ente rpriseEAR] Line 19 Column 248 -- Deployment descriptor file META-INF/persistence.xml in archive [classes]. cvc-complex-type.3.1: Value '2.0' of attribute 'version' of element 'persistence' is not valid with respect to the corresponding attribute use. Attribute 'version' has a fixed value of '1.0'.

Try using Glassfish V3 - it runs JPA 2.0 completely because it is the RI for 2.0 out of the box.

thank you
/michael
http://www.eclipselink.org
Re: EclipseLink 2 and JPA 2.0 [message #503850 is a reply to message #503773] Tue, 15 December 2009 20:37 Go to previous messageGo to next message
Brendan Haverlock is currently offline Brendan HaverlockFriend
Messages: 46
Registered: July 2009
Member
Thanks for the reply,

I am assuming you mean that I can still run this is GF 2.1, but I cannot use any of the JPA 2.0 features in my persistence.xml.

The whole reason I wanted to move to JPA 2.0 was because I was hoping that it would solve a concurrency issue I was having with IndirectMap. Basically, my application kept getting its transactions locked on IndirectMap.get. It was saying it was locked on an object monitor. The postgres transaction was saying idle in transaction and all the the other threads trying to access that table were getting piled up until the app had no more in the connection pool. I tried synchronizing at the very highest level of my object graph, but still, the locks were still happening.

Thanks for the help,

-Brendan
Re: EclipseLink 2 and JPA 2.0 [message #513155 is a reply to message #503773] Tue, 09 February 2010 05:00 Go to previous messageGo to next message
Jon Christiansen is currently offline Jon ChristiansenFriend
Messages: 2
Registered: July 2009
Junior Member
Apologies, but the mentioned URL http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/glas sfish is very unclear as to what the current disposition is on how to get EclipseLink 2.0.0 and/or JPA 2.0 functionality using EclipseLink on Glassfish 2.1

I have a hard requirement to use Glassfish 2.1 at the moment, but really would like to have JPA 2.0 capabilities.

Can you clarify this issue or help put some better/clearer details on the table on the link . ie, last column has no label.

It would be extremely helpful if there were step by step directions on how to correctly configure glassfish 2.1 with the eclipselink 2.0.0 libraries and have full JPA capability.

Or if this doesn't work, if this could be spelled out clearly as that this is currently not supported. (which would a major blow to Eclipselink being useful to most people)

Thanks,
Jon
Re: EclipseLink 2 and JPA 2.0 [message #516305 is a reply to message #503850] Tue, 23 February 2010 15:06 Go to previous messageGo to next message
Doug Clarke is currently offline Doug ClarkeFriend
Messages: 155
Registered: July 2009
Senior Member
Brendan,

I do not believe moving to using the JPA 2.0 API in itself will address the issue you are seeing. EclipseLink 2.0 supports both JPA 1.0 and 2.0 with the same underlying functionality. I believe we need to work through where the synchronization issue is coming from. Can you either open a bug with details or start another thread which we can help you isolate the root cause.

Doug
Re: EclipseLink 2 and JPA 2.0 [message #516312 is a reply to message #513155] Tue, 23 February 2010 15:14 Go to previous message
Doug Clarke is currently offline Doug ClarkeFriend
Messages: 155
Registered: July 2009
Senior Member
Jon,

I will ask one of the GlassFish team to comment on the support of JPA 2.0 in GlassFish v2.1. In general our testing has found that most containers cannot upgrade their core JPA library in previous releases.

What I believe is possible (not saying these are supported configurations) in some containers:

1. Using EclipseLink 2.0 with the JPA 1.0 API library

2. Using EclipseLink 2.0 with the JPA 2.0 API library in application managed mode including the JPA 2.0 API library as an application library.

In JPA container managed mode the container must read in the JPA 2.0 persistence.xml with the new version and additional elements and include this information in its SPI calls to the JPA 2.0 providers. I do not believe it is possible to fully support this in EJB 3.0 containers without explicit support being added for JPA 2.0.

Doug
Previous Topic:EclipseLink and eclipse RCP
Next Topic:Download EclipseLink 2.0.1 - file unavailable
Goto Forum:
  


Current Time: Thu Sep 26 08:50:37 GMT 2024

Powered by FUDForum. Page generated in 0.04727 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top