-->
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.  [ 4 posts ] 
Author Message
 Post subject: SELECT count generates UPDATE statements on oracle
PostPosted: Mon Mar 10, 2008 10:08 am 
Newbie

Joined: Tue Sep 26, 2006 11:54 am
Posts: 10
This happens on hibernate 3.2.6, and older versions as well

When running on Oracle9Dialect, with an Oracle10G DB, Hibernate generates UPDATE statements in cases where we simply send SELECT and SELECT count() statements. This only happens on Oracle. MySQL does not do that. I can provide the generated SQL statements, but before I do that (they are huge), is there an obvious answer to that?

This is causing us lock problems betwen two transacted services, where I feel it should not. One of the transacted call is a read only call that simply does two selects: One select to return paginated rows, and another select that returns the count of all rows.

--
Mel T


Top
 Profile  
 
 Post subject: Same problem with DB2
PostPosted: Mon May 05, 2008 2:09 pm 
Newbie

Joined: Mon May 05, 2008 2:02 pm
Posts: 1
Hi. I found the same problem using Castle Project RC3 (nhibernate build 1.2.0.4000?) and IBM DB2 UDB running on iSeries/AS400.

In fact this update sentences are causing locking problems when I'm just trying to read data, no need to update at all.

I tried to change isolation levels but the problem remains the same.

Just ask if you need more info (generated sql sentences, logs, whatever).

This is a big issue for my application. Hope we get an answer. Thanks!


Top
 Profile  
 
 Post subject: Re: Same problem with DB2
PostPosted: Mon May 05, 2008 4:53 pm 
Newbie

Joined: Tue Sep 26, 2006 11:54 am
Posts: 10
sinnombre00 wrote:
Hi. I found the same problem using Castle Project RC3 (nhibernate build 1.2.0.4000?) and IBM DB2 UDB running on iSeries/AS400.

We eventually fixed the problem. There were calls on our service layer that were transacted (default settings of the transaction annotation) when they should not have been. And because the entities in these calls were eventually updated inside the service, even though we did not call explicitly "update" on the entity manager, hibernate noticed the change and updated the DB. That had gone unnoticed to me.

A cleanup of the transaction declarations fixed the problem.


Top
 Profile  
 
 Post subject: Re: Same problem with DB2
PostPosted: Mon May 05, 2008 4:53 pm 
Newbie

Joined: Tue Sep 26, 2006 11:54 am
Posts: 10
deleted duplicate reply


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.