-->
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.  [ 1 post ] 
Author Message
 Post subject: Handling stale objects (SWT -> AXIS -> SPRING -> HI
PostPosted: Thu May 19, 2005 11:06 pm 
Newbie

Joined: Mon May 16, 2005 12:24 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:2.1.1

Hi All,

I've been facing a problem of stale object being returned, i'll describe the scenario and problem.

Technologies & interaction is as follows:

SWT -> AXIS -> SPRING -> HIBERNATE

WEBSERVER: TOMCAT 4.1.3

documents are being processed by a desktop application developed using swt. only those documents with status 1 or 2 must be fetched for processing. After processing the status changes to 3. The problem is that sometimes (say 5 out of 1000 documents) duplicate documents are loaded. i have verified that database is being updated and from database perspective there is no chance of reloading a document.

As far as the transction is concerned, i am using spring's transaction template which has a block of code which needs to run in the same transaction context.

My requirement is that everytime a fresh document should be available for processing.

i was just going through hibernate reference, and came across the following para:

" Except when you explicity flush(), there are absolutely no guarantees about when the Session executes the JDBC calls, only the order in which they are executed. However, Hibernate does guarantee that the Query.list(..) will never return stale data; nor will they return the wrong data."

instead of using HibernateTemplate, if i replace with session.createQuery.... kinda stuff then will it help me?

i have also used clear and evict to ensure that i get rid of the objects.

i've been bogged up with this situation for some time now.

i know the culprit is me :) there must be some understanding issue,

kindly help me as early as possible.

Thanks a lot.


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

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.