I am making progress with the tutorial, but encounter a new problem in chappter 17.
The example uses 2 classes, Exam and ExamDetail in a OneToOne relation. The example works when I touch both objects with the Hibernate Session.
But using the cascade function, I added the CascadeType.PERSIS annotation:
But I get the TransientObjectException.
Even when I list all the values as shown on page 327, I still get the exception.
However, using the value ALL works fine!
Of course the use of ALL is what we sould normally do but I wonder why PERSIST of even the full list of values generate the exception.
"What you don't know, can't help you"
SCJP (81%), SCWCD (81%), SCJD (354/400), SCBCD (85%)
Okay, this appears to be the morning's "Brain Teaser"
What's the main method. Let us look at it. I'm sure the answer lies within.
Klaas van Gelder
Joined: Jul 08, 2004
My main method is prety straightforward... of course I eliminated the call for saving the Details object to test the cascade funcitonality.
For al clarity: I use the same main method for each test, but it only works with the cascadetype set to ALL and not for PERSIST or even the list of all possible values...
And excuse me for the wrong title of the thread, I meant PERSIST instead of REFRESH...
Have you found a solution to your problem ? I have the same cascading problem with a ManyToMany relation annoted with PERSIST and MERGE.
When the relation is annoted with ALL, the cascading works fine during save, however with PERSIST and MERGE I have the same transient exception you had.