|[Teneo] Unload() questions [message #616230]
||Sat, 12 April 2008 16:04
| Manfred Hahn
Registered: July 2009
I have a question concerning the unload() function. When I started to work
with Teneo, I put the GMF model into the hibernate database as you did in
your GMF tutorial. I had some "java.lang.IllegalStateException: Cannot
modify resource set without a write transaction" notes in the .log file
during unload, so I put an EMF transaction and a Hibernate transaction
around the unload() statement in
XxxDocumentProvider$ResourceSetInfo.dispose(). The exceptions in .log
Now I decided to go a step back and use the XML representation of the GMF
model, leaving the logical model in the hibernate database. (In fact I put
the XML representation in a blob field of the database. I wrote a special
URL handling in the way I had seen in Teneo to manage that.)
But then I discoverd that the model storage seemed to behave in an
unpredictable way: sometimes objects vanished from the model after storing
and reloading. I found out that hibernate deleted objects during the
unload of the resource because they had been marked as orphaned. Every
child object that had been loaded from the database was deleted; newly
created child objects were stored in the database. The reason for this I
don't know exactly but I think the clearing of the resource contents has
something to do with it and the splitting of the resource types. Just to
be shure that my URL handling is not buggy I changed it to a real file URL
for the GMF model. The problems were the same.
So I changed the XxxDocumentProvider$ResourceSetInfo.dispose() back to its
original. Now the database problems are gone but the "Cannot modify
resource set.." exception is again in the .log file.
I manage the hibernate session with one session controller. I have no open
transactions when the application is closed. All database storage actions
are done in the doSave() method. So I expect the unload() function to do
nothing on the database.
These are my questions:
What database actions are expected to be done during unload()?
Should there be an EMF and hibernate transaction open?
Do I have to do something special during unload with my two resource type,
e.g. unloading them in a special sequence? (I had to do this in doSave()
to ensure that the primary keys are set when I store the XML GMF resource)
Powered by FUDForum
. Page generated in 0.02337 seconds