[JBoss Seam] - Re: JPA/Hibernate Entity: broken identity between Entity & O
by Andy Gibson
While the entities are all within the same navigation and request, you may get different entities due to entity manager flushes when queries are run.
When you execute a query, it can flush the entity manager therefore invalidating the entity manager entity cache.
For example :
| MyClass a = entityManager.find(MyClass.class,id);
| MyList = entityManager.createQuery("...").getResultList();
| MyClass b = entityManager.find(MyClass.class,id);
|
Here, I believe 'a' and 'b' would be different objects representing the same entity with the same id because the query caused a flush which invalidated the cache and caused the entity manager to create and load a new instance of the entity.
What you could try, to diagnose the problem a bit is adding :
| entityManager.save(a);
| entityManager.save(b);
|
If one of them is a stale detached object, then the entity manager will complain.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109597#4109597
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109597
18 years, 4 months
[JBoss jBPM] - Re: Problems
by kukeltje
Simon,
I fully disagree. There are many, many developers that use jBPM. There are many small and big companies that use jBPM. The testcases, examples, the forum, wiki AND 'normal' documentation cover most functionality fairly well. The web console which all these posts are referring to is constantly under development and currently only meant to be used for admin functionality and RAD.
If something is missing and you find it out. please report it, instead of a general remarks and things like 'after 2 pages no one has answered my original question'... I DID answer it, on the first page, in my SECOND post.... 11 days ago... and this forum IS for questions... so please... ask them...
The other topics like variables, assignments etc are in many testcases in the source... lots to learn from that.. If you really think you hit a brick wall, then I'm sorry..... you should have tried to evade it and go around it, instead of through.
And why do you think everybody gets angry? The only one that get's angry now and then is me after someone accused me of certain things.... often after asking a question that is in the docs (including testcases!!!) and then they want more from me than pointing them in that direction.
Now it is time to go to sleep (03:27 here)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109594#4109594
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4109594
18 years, 4 months