-->
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: Distributed Blackboard with Hibernate, is it possible?
PostPosted: Fri Jan 19, 2007 9:38 pm 
Newbie

Joined: Mon May 29, 2006 4:30 am
Posts: 4
I hope this is the correct forum to be posting this to, none of the others really seem to be a fit for this idea/question/seeking of advice.

I am developing a swing 2-tier application which connects directly to the database. Part of this application requires a "distributed blackboard" (what they call it in Hunt and Thomas' The Pragatic Programmer) for users to upload files to. Effectively I suppose what I am aiming for is a Javaspaces style blackboard using hibernate as the persistence mechanism. I can't just use Javaspaces as there's a fair overhead to using it in the first place, and I also want to be able to run the application in standalone (on the one machine) and client-server modes.

I can detect the addition of a file using a HibernateInterceptor (the onSave, onFlushDirty) and send a message via JMS of the class that owns the file (Parent.class), and it's primary key.

On another client I can receive the object added/removed messages from JMS and update the client's collections of the objects (for an add using Session.load(Class, Serializable) and for a remove Session.evict()). However when the receiving client flushes the session I get BatchUpdateFailed exceptions from Hibernate.

I have tried refreshing and merging the Parent persisted instance with the session, and manually manipulating the collection of Child object's associated with it with no luck. I've also tried playing with the version and unsaved-value properties of my classes, however when I do this I get an Exception.

Has anyone out there tried doing a similar collaborative system in Hibernate, or can anyone point out why this approach won't work?

Thankyou.


Last edited by aidos on Fri Jan 19, 2007 10:14 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 19, 2007 10:07 pm 
Newbie

Joined: Mon May 29, 2006 4:30 am
Posts: 4
I should add that ideally I would like changes made by other clients to appear automatically in the Swing UI table that displays all Child objects associated with the Parent, but any changes made locally to be sent out to the other clients when save is pressed.

I would rather not have to open a transaction, flush and commit on every user action if I can help it (as per Christians Swing example blog post appears to do), if this can't be done then I will wear the change, but it doesn't really fit with the way the rest of the application works.


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.