Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Unload() questions
[Teneo] Unload() questions [message #616230] Sat, 12 April 2008 16:04
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi Martin,

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
where gone.

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)

Best regards
Manfred
Previous Topic:[Net4j] newbee: Example for a simple server and client
Next Topic:Search for all references to a specific instance
Goto Forum:
  


Current Time: Tue Apr 07 21:19:31 GMT 2020

Powered by FUDForum. Page generated in 0.02337 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top