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: Anything wrong with this transaction logic? I think so.
PostPosted: Wed Jan 03, 2007 11:35 pm 
Newbie

Joined: Mon Jan 09, 2006 8:14 pm
Posts: 3
Heres my scenario:

I make a call to my external database which returns +1000 records. I would then cache all of them in DB2 using Hibernate3. I only use my cache as a local read-only copy of the external database. If I want to add an additional record, that record will be sent to the external database to be sorted or verified before it is committed. Once that is successful, I make an additional call to that external database to get those +1000 records again. My local copy of those data would all be wiped out from the cache and an add is performed on those new records again.

The problem is that the external database has special knowledge of how records are ordered. I have to make that additional external database call to get the accurate list of records to be cached. As a result, I have no way of reattaching the persisted object to be cached again.

I am new to Hibernate and database concepts so please help me. Does anyone have any tips on how to improve the above procedure with all the adding, deleting, and adding again all in one transaction?

Thanks
Sub


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 04, 2007 4:05 am 
Regular
Regular

Joined: Thu Aug 17, 2006 4:50 am
Posts: 55
Location: Mallorca
I am not sure if I understand the problem correctly, but I suggest you to use the second level cache provided by Hibernate instead of a local database.

The cache content will be managed transparently to the application by hibernate, performance will be better and, more importantly, application code will be MUCH simpler.


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.