-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: forcible update of objects from DB?
PostPosted: Mon Sep 10, 2007 9:51 am 
Newbie

Joined: Mon Sep 10, 2007 8:29 am
Posts: 2
Location: Edinburgh, Scotland
Hello,
I am developing an Eclipse RCP graphical editor application for biological pathways using
Eclipse Europa, hibernate3.2.2 with a hypersonic 1.8 database.

Our business model directly backs the application viewers. At present
we have a 'summary' view where we display name, description etc of a
given diagram. The diagram contents are not initialised (i.e., they are 'lazilyloaded' until an explict 'open diagram' instruction from the UI.

This works fine. If we now edit the diagram, and opt NOT to save the changes,
close it, and reopen it, the model is still present and so is at the state before closure. If we read the model in again from the DB, Hibernate throws an exception that there are 2 objects with the same DB id in the same session.

What we would really like to be able to do is return to the state before the
diagram was first loaded, with just the proxy for the diagram. iIe., forcibly make the model show the database data again.We have been
trying refresh() and evict() but get various hibernate errors.

I should say that after each DB operation we detach the objects from the
session and close the session, for return to the UI.

Any help on getting the right sequence of events would be very helpful.
Thank you!

Richard


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 3:09 am 
Newbie

Joined: Mon Sep 10, 2007 8:29 am
Posts: 2
Location: Edinburgh, Scotland
I'd just like to add, that our current solution is for the diagram contents not to
hold any reference to the diagram descriptor object. This prevents the problem in my previous post but is not an ideal solution as every time we want to get description info from within a diagram we need to do a DB query
to associate the diagram contents with the diagram descriptor.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.