What is your JPA provider?

Btw how are you checking the object id? If you're looking at its hashcode
that wont tell you anything as hashcodes can repeat. Im not familiar with
eclipse's debugger. We have tests asserting that entitymanagers should not
cross, so I wonder if it is some flushing issue with your JPA provider?

Dhanji.

On Wed, Oct 6, 2010 at 5:13 AM, mgbowman <[email protected]>wrote:

> This is a shot in the dark but let me explain what's going on...
>
> I'm using guice + guice-servlet + guice-persist (20100927) in my
> current development efforts. Every method in my business logic which
> access the EntityManager is annotated with @Transactional. Using the
> Eclipse debugger, I can confirm that at the end of every Transaction
> the call to JpaPersistService.end() is called which removes the
> ThreadLocal EntityManager instance.
>
> It seems that on subsequent requests which are handled by a thread
> which had already serviced a previous request, the ThreadLocal returns
> a previously created EntityManager (confirmed by the object id in the
> Eclipse debugger) which is returning a 'stale' state of the database.
>
> I'm completely at a loss of words on this and I'm going to debug it
> more tomorrow. If there's any chance that anybody could give any sort
> of insight, it will be greatly appreciated.
>
> I will update with any new info as I uncover it.
>
> Thanks in advanced,
> --mgbowman
>
> Note: I'm running on Java 1.6 + Tomcat 6.0.29 under OS X 10.6.4
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to