We have a critical problem in our application, we have multiple enterprise
applications and we have to use distributed transactions to ensure ACID
operations on entire system.
Our Application server is Glassfish V9 update 5 on SUSE 10 and database is
Oracle 10.2.0.1.0.
The problem is when we
Hi,
Set the cascade attribute for this field to CascadeType.PERSIST or
CascadeType.ALL (JPA annotations) or persist or all (JPA orm.xml), or
enable cascade-persist globally, or manually persist the related field value
prior to flushing.
In your example, can you please try the following and
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
Hello all,
I've got a problem with the update of a manyToOne field which is mapped
by another entity. I searched and tried out for the last week and I
didn't had success, so I ask here. BTW, I'm new to JPA so maybe it's a
conceptual problem.
My test case is fairly simple. I've got to
Hi Stefan - I think your A.SetB(B) method must call B.add(A)
From section 2.1.7 in JPA Specification - Note that it is the
application that bears responsibility for maintaining the consistency of
runtime relationships---for example, for insuring that the one and the
many sides of a
Hi Paul,
Yes you are correct about unmanaged.
Using cascadeAll on account and calling entityManager.persist(voucher) will
make the account object also persistent.
So, I am guessing my suggestion should work fine.
Regards,
Ravi.
unmanaged means the Account object assigned to the ManyToOne
Hi Paul,
Thanks for the clarification.
I overlooked Account account = entityManager.find(Account.class, 215L);
The above statement is supposed to return a proper entity object in return.
I would assume the original code in problem description should work fine.
I will try to run it against
Hi,
I am unable to replicate the issue. The sample code you mentioned in problem
description is working as expected on weblogic application server with oracle
database (10.1.0.2) and oracle XA driver (Oracle JDBC Driver version -
10.1.0.2.0).
Here is the configuration I used: