Re: persistence problem in distributed environment

2009-05-17 Thread is_maximum
gt;> private Long id; >> >> @ManyToOne >> @JoinColumn(name = "account_id") >> private Account account; >> } >> >> public class Account { >> @Id >> @Column(name = "id") >> @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = >> "AccountSequenceGenerator") >> private Long id; >> } >> >> Account account = entityManager.find(Account.class, 215L); >> Voucher voucher = new Voucher(); >> Voucher.setAccount(account); >> entityManager.persist(voucher); >> >> >> >> >> >> >> > > > -- View this message in context: http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2915723.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: persistence problem in distributed environment

2009-04-13 Thread Paul Copeland
Does the test below fail for you? It works correctly for Ravi. Can you send an example that demonstrates the problem? On 4/13/2009 8:08 AM, hmmahboobi wrote: Hi Thanks for your response, This model is a small view of our large system, Actual codes are very large and complex, so I cant send

Re: persistence problem in distributed environment

2009-04-13 Thread hmmahboobi
tor") private Long id; } Account account = entityManager.find(Account.class, 215L); Voucher voucher = new Voucher(); Voucher.setAccount(account); entityManager.persist(voucher); -- View this message in context: http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2628161.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: persistence problem in distributed environment

2009-04-11 Thread rpalache
tedValue(strategy = GenerationType.SEQUENCE, generator = "AccountSequenceGenerator") private Long id; } Account account = entityManager.find(Account.class, 215L); Voucher voucher = new Voucher(); Voucher.setAccount(account); entityManager.persist(voucher); -- View this message in context

Re: persistence problem in distributed environment

2009-04-11 Thread rpalache
d") > private Account account; > } > > public class Account { > @Id > @Column(name = "id") > @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = > "AccountSequenceGenerator") > private Long id; > } > > Account account = entityManager.find(Account.class, 215L); > Voucher voucher = new Voucher(); > Voucher.setAccount(account); > entityManager.persist(voucher); > > > > > -- View this message in context: http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2622901.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: persistence problem in distributed environment

2009-04-11 Thread rpalache
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = > "AccountSequenceGenerator") > private Long id; > } > > Account account = entityManager.find(Account.class, 215L); > Voucher voucher = new Voucher(); > Voucher.setAccount(account); > entityManager.persist(voucher); > > > > > -- View this message in context: http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2622747.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: persistence problem in distributed environment

2009-04-11 Thread Paul Copeland
"unmanaged" means the Account object assigned to the ManyToOne field is new and not yet persistent, removed, or detached. On 4/11/2009 7:46 AM, rpalache wrote: Hi, "Set the cascade attribute for this field to CascadeType.PERSIST or CascadeType.ALL (JPA annotations) or "persist" or "all" (JPA

Re: persistence problem in distributed environment

2009-04-11 Thread rpalache
Account account = entityManager.find(Account.class, 215L); Voucher voucher = new Voucher(); Voucher.setAccount(account); entityManager.persist(voucher); -- View this message in context: http://n2.nabble.com/persistence-problem-in-distributed-environment-tp2619875p2620799.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

persistence problem in distributed environment

2009-04-11 Thread hmmahboobi
.SEQUENCE, generator = "AccountSequenceGenerator") private Long id; } Account account = entityManager.find(Account.class, 215L); Voucher voucher = new Voucher(); Voucher.setAccount(account); entityManager.persist(voucher); -- View this message in context: http://n2.nabble.com