Thanks Lenny - I'm sure this will come in handy and has given me a few hours
head start on myself,
Cheers
Chris
On 24/09/2011, at 2:26 AM, Lenny Primak wrote:
> Yes indeed. The relationships between JPA, tap-JPA, and entities themselves
> isn't clearly documented.
> It took me a while to figure out what the relationship was.
>
> tap-jpa and EJB packaging can coexist and must coexist peacefully.
> The key to understanding this is how annotation processing works.
> tapestry-jpa implements annotations via tapestry-ioc, while glassfish does
> this via JEE annotation processing methods.
>
> For example, @PersistenceContext and @EntityManager annotations are processed
> by tapestyr-jpa in tapestry packages only,
> while they are processed by JEE/EJB code in glassfish in @Stateless/@Stateful
> EJBs only.
>
> If you put @Stateless session bean, for example inside a tapestry package
> (xxx.components, for example)
> and declare a @PersistenceContext there,
> then you will have a clash because both tapestry and glassfish will both try
> to process the annotation.
>
> Hoep this helps
>
> On Sep 23, 2011, at 9:24 AM, Chris Mylonas wrote:
>
>> This is my lack of having not tested tapestry-jpa at all!!!
>> If tap-jpa reads the same persistence.xml as my ejb-jar omg `kin rad!!
>>
>> otherwise - don't worry - this takes it to [OT] off topic.
>>
>> i don't understand the j2ee packaging that well - so take my knowledge with
>> a grain of salt for now re: java packaging and how that works. i'm into
>> protocol analysis on network stuff cos I like to connect things together
>> (like most of us).
>>
>> i do not understand the relationship betweeen:
>> 1.. persistence.xml in an ejb-jar; and,
>> 2... persistence.xml in tapestry-jpa jar
>> and whether the two can co-exist in the same ear project (i.e. how an entity
>> manager works in both cases)
>>
>> which is beyond this mailing lists purpose.
>>
>>
>> This is stuff I'll hammer out with some testing in due course :)
>>
>>
>> Tapestry enables me to do web stuff "IN JAVA" much easier than mangling bits
>> of non-UI java database stuff (e.g. EJB) than with php (ie. drupal cos it's
>> easily hackable in the spaghetti code sense because that's the nature of the
>> language IMO)
>>
>> which for me enables me to be a more productive/better progammer which
>> I've been waiting for, for years!!!
>> Hope that makes sense, both in my lack of understanding of java stuff - and
>> where I expect tapestry to take things for me :)
>>
>> The rate at which stuff happens in this tapestry community is incredible to
>> say the least, I just hope I can catch up - economically, socially,
>> engineer-ily, glue-ily, technically etc..
>>
>>
>> Cheers
>> Chris
>>
>>
>> On 23/09/2011, at 4:22 PM, Lenny Primak wrote:
>>
>>> I don't understand this last message.
>>> Tapestry-jpa module reads the same persistense.xml file as the JPA in
>>> glassfish.
>>> The only thing that's different is that glassfish does annotation
>>> processing inside JEE-annotated classes (session beans)
>>> and the tapestry-jpa module does the same within tapestry-ioc packages.
>>>
>>> On Sep 23, 2011, at 2:18 AM, Chris Mylonas wrote:
>>>
Good to know - my understanding of entity managers is low, so I was
thinking the two lots of persistence.xml files would mean 2 entity
managers, one for tapestry-jpa and one for EJB, unless tapestry-jpa can
get the EJB's persistence.xml through java packaging magic.
Stuff for me to learn unless someone can give a definitive "this is how it
works"
Have a good weekend,
Chris
On 23/09/2011, at 4:14 PM, Lenny Primak wrote:
> I am using JPA module from 5.3 no problems, not sure about 5.2, but I
> don't think that it should be an issue
> I don't see any issues of mixing JPA module with EJB3 because I use it
> myself
> On Sep 22, 2011, at 6:12 PM, Chris Mylonas wrote:
>
>> Thanks Lenny
>> I'm on GF 3.1.1 + tapestry 5.2.5 no JPA module, just using the jumpstart
>> stuff from the EJB3 sample.
>>
>>
>> Can I mix tapestry-jpa with EJB3 stuff without causing problems for
>> entity manager? Or would the web stuff be safer to be read-only?
>>
>>
>>
>> On 22/09/2011, at 11:55 PM, Lenny Primak wrote:
>>
>>> Just to let you know, I am using GF 3.1.1 and tapestry 5.3 beta 5 with
>>> built in JPA module and I have no such issue.
>>>
>>>
>>>
>>> On Sep 22, 2011, at 6:12 AM, Chris Mylonas wrote:
>>>
OMG!! - That did the trick!!
The magic is in persistence.xml
Thank you Geoff you champion
I wonder what it will do to "performance, caching and change
tracking" because according to that page, that's what weaving is for.
PID USE