You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Dario Andrade <da...@sinistro.net> on 2007/02/24 23:52:41 UTC

JPA in geronimo

How do I assemble a project in order to use geronimo's jpa support?

Does anyone recommend toplink jar lib or openjpa to be added to my class 
path?

Thanks
Dario Andrade

Re: JPA in geronimo

Posted by Lasantha Ranaweera <la...@opensource.lk>.
Thanks folks ...

So we have to find otherway to replace default JPA provider class name I
think.

I would be thankful if somebody please review GERONIMO-2899 JIRA patch too
and let me know the status. :)

Thanks Again,
Lasantha


> On Feb 28, 2007, at 12:50 PM, Jacek Laskowski wrote:
>
>> On 2/28/07, Lasantha Ranaweera <la...@opensource.lk> wrote:
>>
>>> For the JPA side I think now we need not hard coded openjpa JPA
>>> provider
>>> class name.  Am I correct David (Is there any situations where
>>> both CMP
>>> and JPA comes together)?
>>
>> As far as I understand the spec, ear can contain CMPs and JPA
>> entities. It's not recommended that CMPs and JPAs are mixed together
>> in one jar file, but it's very legitimate to have them separated in
>> two jars bundled in one ear (I'd be glad if someone - perhaps one with
>> leading 'D' in his first name, could verify my understanding, though
>> ;-)).
>
> That is the standard recommendation, but doesn't hold for Geronimo or
> OpenEJB.  The reason that experts recommend this is because normally
> the CMP and JPA are separate persistence systems.  This means that
> you have two separate caches, locks, flush semantics and so on, so if
> you are not careful you can corrupt your database.  In OpenEJB we
> chose to use JPA for the CMP implementation, which means you only
> have one system with two views, so you in general don't have the
> perviously mentioned problems.
>
> -dain
>


Re: JPA in geronimo

Posted by Dain Sundstrom <da...@iq80.com>.
On Feb 28, 2007, at 12:50 PM, Jacek Laskowski wrote:

> On 2/28/07, Lasantha Ranaweera <la...@opensource.lk> wrote:
>
>> For the JPA side I think now we need not hard coded openjpa JPA  
>> provider
>> class name.  Am I correct David (Is there any situations where  
>> both CMP
>> and JPA comes together)?
>
> As far as I understand the spec, ear can contain CMPs and JPA
> entities. It's not recommended that CMPs and JPAs are mixed together
> in one jar file, but it's very legitimate to have them separated in
> two jars bundled in one ear (I'd be glad if someone - perhaps one with
> leading 'D' in his first name, could verify my understanding, though
> ;-)).

That is the standard recommendation, but doesn't hold for Geronimo or  
OpenEJB.  The reason that experts recommend this is because normally  
the CMP and JPA are separate persistence systems.  This means that  
you have two separate caches, locks, flush semantics and so on, so if  
you are not careful you can corrupt your database.  In OpenEJB we  
chose to use JPA for the CMP implementation, which means you only  
have one system with two views, so you in general don't have the  
perviously mentioned problems.

-dain

Re: JPA in geronimo

Posted by Jacek Laskowski <ja...@laskowski.net.pl>.
On 2/28/07, Lasantha Ranaweera <la...@opensource.lk> wrote:

> For the JPA side I think now we need not hard coded openjpa JPA provider
> class name.  Am I correct David (Is there any situations where both CMP
> and JPA comes together)?

As far as I understand the spec, ear can contain CMPs and JPA
entities. It's not recommended that CMPs and JPAs are mixed together
in one jar file, but it's very legitimate to have them separated in
two jars bundled in one ear (I'd be glad if someone - perhaps one with
leading 'D' in his first name, could verify my understanding, though
;-)).

Jacek

-- 
Jacek Laskowski
http://www.JacekLaskowski.pl

Re: JPA in geronimo

Posted by Lasantha Ranaweera <la...@opensource.lk>.
Hi David J & Dain,

Thank you very much for you guys information.

According to the Dain's information I have created a JIRA issue 
(GERONIMO-2899) & submitted a patch. It will now only create "cmp" if 
there is cmp information found in the ejb-jar.xml (please note it will 
create only one cmp).

For the JPA side I think now we need not hard coded openjpa JPA provider 
class name.  Am I correct David (Is there any situations where both CMP 
and JPA comes together)?  If we could remove this provider name that 
would be much easier for me in Cayenne work I am carrying out right now  
:-) .

Thanks,
Lasantha

Dain Sundstrom wrote:
> On Feb 25, 2007, at 2:11 AM, David Jencks wrote:
>
>> On Feb 24, 2007, at 8:47 PM, Lasantha Ranaweera wrote:
>>
>>> Hi David,
>>>
>>> I have been going on this same jpa sample given on testsuite and 
>>> having a
>>> problem too (may be I am missing some basic thing in JSR). Anyway 
>>> thought
>>> to give a try on this same thread it looks iron is hot here and it will
>>> give some insight on G to our users too. ;)
>>>
>>> In my debugging enviroment shows that above sample application 
>>> creates 3
>>> PersistenceUnitGBeans. The one I dont understand it named 'cmp'. Where
>>> does it comes from ? Either 'persistence.xml' or 'openejb-jar.xml' 
>>> doesn't
>>> have that information know. Do you have any idea what is I am missing
>>> here?
>>
>> That one is created by some magic code dain wrote to map cmp 2.1 
>> entity beans to jpa.  Apparently it shows up even if you have no 
>> entity beans.
>
> It should only be created if your application has CMP entities.  If 
> notice this code creating a persistence unit for applications without 
> CMP entities, it is a bug.
>
> -dain
>



Re: JPA in geronimo

Posted by Dain Sundstrom <da...@iq80.com>.
On Feb 25, 2007, at 2:11 AM, David Jencks wrote:

> On Feb 24, 2007, at 8:47 PM, Lasantha Ranaweera wrote:
>
>> Hi David,
>>
>> I have been going on this same jpa sample given on testsuite and  
>> having a
>> problem too (may be I am missing some basic thing in JSR). Anyway  
>> thought
>> to give a try on this same thread it looks iron is hot here and it  
>> will
>> give some insight on G to our users too. ;)
>>
>> In my debugging enviroment shows that above sample application  
>> creates 3
>> PersistenceUnitGBeans. The one I dont understand it named 'cmp'.  
>> Where
>> does it comes from ? Either 'persistence.xml' or 'openejb-jar.xml'  
>> doesn't
>> have that information know. Do you have any idea what is I am missing
>> here?
>
> That one is created by some magic code dain wrote to map cmp 2.1  
> entity beans to jpa.  Apparently it shows up even if you have no  
> entity beans.

It should only be created if your application has CMP entities.  If  
notice this code creating a persistence unit for applications without  
CMP entities, it is a bug.

-dain

Re: JPA in geronimo

Posted by David Jencks <da...@yahoo.com>.
On Feb 24, 2007, at 8:47 PM, Lasantha Ranaweera wrote:

> Hi David,
>
> I have been going on this same jpa sample given on testsuite and  
> having a
> problem too (may be I am missing some basic thing in JSR). Anyway  
> thought
> to give a try on this same thread it looks iron is hot here and it  
> will
> give some insight on G to our users too. ;)
>
> In my debugging enviroment shows that above sample application  
> creates 3
> PersistenceUnitGBeans. The one I dont understand it named 'cmp'. Where
> does it comes from ? Either 'persistence.xml' or 'openejb-jar.xml'  
> doesn't
> have that information know. Do you have any idea what is I am missing
> here?

That one is created by some magic code dain wrote to map cmp 2.1  
entity beans to jpa.  Apparently it shows up even if you have no  
entity beans.

thanks
david jencks

>
> Thanks,
> Lasantha
>
>> For g 1.2 you can consult the daytrader jpa mode (daytrader 1.2
>> IIUC).  G 1.2 is not jaaee5 compliant so you have to use a bunch of
>> proprietary features.
>> for g 2.0 you can consult the ttestsuite/enterprise-testsuite/jpa-
>> tests/ which has a very simple example that I think is using only
>> spec features.  I think pretty much everything is working except
>> persistence-context-ref and persistence-unit-ref injection.  That
>> might work in ejbs.
>>
>> Hope this helps
>> david jencks
>


Re: JPA in geronimo

Posted by Lasantha Ranaweera <la...@opensource.lk>.
Hi David,

I have been going on this same jpa sample given on testsuite and having a
problem too (may be I am missing some basic thing in JSR). Anyway thought
to give a try on this same thread it looks iron is hot here and it will
give some insight on G to our users too. ;)

In my debugging enviroment shows that above sample application creates 3
PersistenceUnitGBeans. The one I dont understand it named 'cmp'. Where
does it comes from ? Either 'persistence.xml' or 'openejb-jar.xml' doesn't
have that information know. Do you have any idea what is I am missing
here?

Thanks,
Lasantha

> For g 1.2 you can consult the daytrader jpa mode (daytrader 1.2
> IIUC).  G 1.2 is not jaaee5 compliant so you have to use a bunch of
> proprietary features.
> for g 2.0 you can consult the ttestsuite/enterprise-testsuite/jpa-
> tests/ which has a very simple example that I think is using only
> spec features.  I think pretty much everything is working except
> persistence-context-ref and persistence-unit-ref injection.  That
> might work in ejbs.
>
> Hope this helps
> david jencks


[ANN] VTD-XML 2.0

Posted by Jimmy Zhang <cr...@comcast.net>.
 The VTD-XML project team is proud to announce the release of 
version 2.0 of VTD-XML, the next generation XML parser/indexer.
The new features introduced in this version are:

* VTD+XML version 1.0: the world's first true native XML index 
that is simple, general-purpose and back-compatible with XML. 
* NodeRecorder Class that saves VTDNav's cursor location for 
later sequential access.
* Overwrite capability
* Lexically comparisons between VTD and strings

 To download the software, please go to 
http://sourceforge.net/project/showfiles.php?group_id=110612

 To read the latest benchmark report please go to
http://vtd-xml.sf.net/benchmark1.html

 To get the latest API overview
http://www.ximpleware.com/vtd-xml_intro.pdf


Re: JPA in geronimo

Posted by Dario Andrade <da...@sinistro.net>.
Thanks David,
I guess I failed to explain I would try jpa on geronimo 2.0 M2. Anyway, 
I copied the toplink jpa standalone library (specifically 
toplink-essentials.jar) to my project and now it recognizes jpa 
annotations and classes.
Before I move on, I was just asking if there was something else I should 
be looking at, besides creating a dependency on 
geronimo/openjpa/2.0-M2/car module.

Thanks again,
Dario Andrade


David Jencks escreveu:
> For g 1.2 you can consult the daytrader jpa mode (daytrader 1.2 
> IIUC).  G 1.2 is not jaaee5 compliant so you have to use a bunch of 
> proprietary features.
> for g 2.0 you can consult the 
> ttestsuite/enterprise-testsuite/jpa-tests/ which has a very simple 
> example that I think is using only spec features.  I think pretty much 
> everything is working except persistence-context-ref and 
> persistence-unit-ref injection.  That might work in ejbs.
>
> Hope this helps
> david jencks
>
>
> On Feb 24, 2007, at 2:52 PM, Dario Andrade wrote:
>
>>
>> How do I assemble a project in order to use geronimo's jpa support?
>>
>> Does anyone recommend toplink jar lib or openjpa to be added to my 
>> class path?
>>
>> Thanks
>> Dario Andrade


Re: JPA in geronimo

Posted by David Jencks <da...@yahoo.com>.
For g 1.2 you can consult the daytrader jpa mode (daytrader 1.2  
IIUC).  G 1.2 is not jaaee5 compliant so you have to use a bunch of  
proprietary features.
for g 2.0 you can consult the ttestsuite/enterprise-testsuite/jpa- 
tests/ which has a very simple example that I think is using only  
spec features.  I think pretty much everything is working except  
persistence-context-ref and persistence-unit-ref injection.  That  
might work in ejbs.

Hope this helps
david jencks


On Feb 24, 2007, at 2:52 PM, Dario Andrade wrote:

>
> How do I assemble a project in order to use geronimo's jpa support?
>
> Does anyone recommend toplink jar lib or openjpa to be added to my  
> class path?
>
> Thanks
> Dario Andrade


Re: JPA in geronimo

Posted by Dain Sundstrom <da...@iq80.com>.
On Feb 24, 2007, at 2:52 PM, Dario Andrade wrote:

> How do I assemble a project in order to use geronimo's jpa support?
>
> Does anyone recommend toplink jar lib or openjpa to be added to my  
> class path?

I highly recommend OpenJPA over toplink.  I find toplink much more  
picky and hard to understand then OpenJPA.  Also, I find it easier to  
get help and fixes from OpenJPA.

-dain