File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes does commit return before transaction complete Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "does commit return before transaction complete" Watch "does commit return before transaction complete" New topic
Author

does commit return before transaction complete

Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
Hello All,

I have a ques.. can you tell me whats going on here:
I request an update and then try to read the updated data.. but I do not see the changes in my jsp (I do see the changes in database).. then I do a refresh on my jsp again which calls getDetails() method and this time I do see the changes on jsp also.
So does this mean that the jdbc commit is taking its time in the background while it returns the control back to the update method ?
Here's a quick simple idea of what I do:



Any help is appreciated.. Tks!
Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
no suggestions ??
Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
    
    1
Don't think this is a database issue. Do some debugging and check your request/response cycle.
Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
Hi Chu,
If I go in debugging mode.. I can't get it to fail because I think I've slowed the process down and so this race condition never occurs. any other suggestions ?
tks
Arulanand Dayalan
Ranch Hand

Joined: Aug 10, 2005
Posts: 124
Do you Clear the cache in your Jsp. This could be because of that. If this code is not in your jsp, add it and check it out.


Hope this helps.

Thanks and Regards,
Arul.
Raj Bhandari
Ranch Hand

Joined: Oct 19, 2005
Posts: 97
Hi Arul,

Tks for the suggestion but its not a jsp cache issue because I have multiple tiles (using struts) in my jsp and all come back with the latest updated values except one particular tile which comes from a table which has to do some extra work via its triggers when I update that table.
I've put debugging statements before and after the service calls and it clearly shows old data for that table coming back.. but when I call that service to get results from that table again.. everything is fine.
I have no ideas what can I do to tell my update method to wait until the commit is totally complete. Not even sure if its that issue..
tks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: does commit return before transaction complete