-->
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.  [ 7 posts ] 
Author Message
 Post subject: sqlserver and locking?
PostPosted: Thu Nov 06, 2003 9:48 am 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
Has anyone had problems using sqlserver and having it lock you out of enterprise manager/query analyzer if the connection pool is set to anything > 0 (or if you currently have a hibernateSession open)?

Here are some of the symptoms and info:

1) I've started using MS's jdbc driver and then switched to JTDS 0.5.1. Same problem with both. (Any other free sqlserver jdbc drivers out there?)

2) when any connections open from hibernate, neither query analyzer or enterprise manager can query the database.

3) The session.save(myObject) call doesn't throw any exceptions, but it doesn't write anything to the database (even after a .flush, .close). It does assign an identity to the object (with generator="native") which seems to imply that it thought things went well.

4) If connectionpool.size > 0, even if I flush,close my hibernate session, problem #2 still exitss.

Any ideas? I am trying to transition an existing site to hibernate and won't be able to switch to a nice database until I get all the stored procedures and existing code ported.

-mp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 12:38 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
are you using transactions? If not it should be the reason.

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 12:42 pm 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
micho2001 wrote:
are you using transactions? If not it should be the reason.


Meaning, I HAVE to use transactions to use mssql?

-mp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 12:55 pm 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
Wow. That did it. That'll teach me to try to get the simple case working first...

If that's not in the documentation somewhere, it should be. I didn't find it, but I suck at search the web and reading docs.

-mp


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 1:29 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
it shouldnt lock on selects though.. just on inserts and updates...

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 06, 2003 1:34 pm 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
yep. That's what it was doing.

-mp


Top
 Profile  
 
 Post subject: workaround for needing transactions?
PostPosted: Tue Nov 11, 2003 10:18 am 
Beginner
Beginner

Joined: Tue Oct 28, 2003 12:09 pm
Posts: 46
Is there a way to stop sqlserver from requiring transactions when using hibernate?

I'm running into a problem where I want to call a getSize() method on one of my objects which calls a calculateSize() method to determine the size on the first call.

The code isn't creating a transaction because (as far as it knows) it's not writing anything to the database.

This causes sqlserver to lock up because the flush/close call on the session is causing the size property to be written out to the database since it's been updated (albeit not by the calling code).

This is easy to work around (just not caching size, or manually setting a transaction, etc) but it makes me nervous to have to catch all the interactions like this.

I don't want my objects to have to be aware that they are being persisted by hibernate to a sqlserver database so they can't do "things like that".

Thoughts? Other than "don't use sqlserver"?

-mp


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