ok, thank you.

The transaction boundry was ok in my original code, but the first tip was the 
right one.

But there is another question. What about relationships like this:


  | UserTransaction ut = sessionContext.getUserTransaction();
  | ut.begin();
  | MyEntity a = em.find(MyEntity.class, Long.valueOf(1));
  | ut.commit();
  | 
  | ut = sessionContext.getUserTransaction();
  | ut.begin();
  | a.setName("FOO2");
  | MyRelatedBean b = a.getMyRelatedBean();
  | em.merge(a);
  | ut.commit();
  | 

Of course, that ends with a LazyInitializeException. But can I 'integrate' a 
bean in the transaction to use it as normal accessed (via find or Query) bean?

Greetings
Klaus

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3986760#3986760

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3986760
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to