-->
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: Transaction Isolation
PostPosted: Mon Nov 10, 2003 9:05 pm 
Beginner
Beginner

Joined: Mon Nov 10, 2003 7:09 pm
Posts: 28
This is a bit of a silly question, but I'm curious to know:

What does hibernate use as the default transaction isolation (under 1.2.x), assuming I fail to provide one in the hibernate.properties file?

Thanks,

Ken


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Whatever your database defaults to ;)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:19 pm 
Beginner
Beginner

Joined: Mon Nov 10, 2003 7:09 pm
Posts: 28
Hehe, so somewhere between TRANSACTION_READ_UNCOMMITTED and TRANSACTION_SERIALIZABLE. I know you're a DB2 guy Gavin (I'm stuck with DB2/400, which is a different engine but should be similar), do you know what the DB2 default is off the top of your head?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
err I have not used db2 in the past year except for Hibernate testing - and never on AS/400 - but anyway, IIRC, the default is actually what DB2 calls "repeatable read", which is what ANSI calls serializable. You probably want to change it to "cursor stability" (read committed) or "read stability" (repeatable read) if you want high concurrency. If you are using Hibernate, I would go for read committed, especially if you are

(a) using versioning (optimistic locking)
(b) using the second-level cache

This is hilarious, actually:

Code:
ANSI                   DB2                    Oracle
serializable           repeatable read        N/A
repeatable read        read stability         serializable


wtf?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:49 pm 
Beginner
Beginner

Joined: Mon Nov 10, 2003 7:09 pm
Posts: 28
Some digging around deep in the JDBC drivers (which are a byzantine mess as you might imagine) and it *looks* like they're defaulting to TRANSACTION_READ_UNCOMMITTED. I'll look into using READ_COMMITTED though, since we are in fact making heavy use of optimistic locking via <timestamp>.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 10, 2003 9:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
eh? Read uncommitted is evil! You mean that your jdbc driver defaults to this??


Note that it is possible to change the default transaction isolation level by editing one of db2's config files....


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2003 1:31 pm 
Beginner
Beginner

Joined: Mon Nov 10, 2003 7:09 pm
Posts: 28
Yep, the IBM JDBC driver for the AS/400 defaults to READ_UNCOMMITTED. I finally gave up trying to trace through exactly why I was unable to set any value via hibernate.connection.isolation (message board seems to indicate that they've tied the autocommit and isolation level props together in some way, and just to use URL props), and am just setting it via a connection property on the URL.

Thanks for the help


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.