[jboss-user] [JBoss Seam] - Re: Creating several objects in one transaction.

evdelst do-not-reply at jboss.com
Sun Dec 30 14:04:00 EST 2007


Easiest is to add the persons to a list you store in the bean.

eg.

private Person person; 
  | 
  | private List<Person> list=new ArrayList<Person>();
  | 
  | void add() {
  |    list.add(person);
  |   person = new Person();
  | )

Then in your commit method, iterate the list and call em.persist for each element.
No need to use Flushmode.manual for this kind of interaction.
Also, the transaction is tied to a single method call (= a good thing).



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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116110



More information about the jboss-user mailing list