-->
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.  [ 2 posts ] 
Author Message
 Post subject: Doc suggestion for connection settings
PostPosted: Wed Nov 02, 2005 3:14 pm 
Beginner
Beginner

Joined: Tue Jun 07, 2005 11:36 pm
Posts: 22
Hibernate version: 3.0.5

First, let me say how much I appreciate the extensive documentation on Hibernate, both in the reference manual and the forums+wiki. Combined, these resources have kept me from posting a lot of "RTFM" questions here. I have a small suggestion for the reference manual that will hopefully keep others from spending an embarrassing amount of time (like I did) trying to figure out why their code worked fine in unit tests but not when running in a hosted environment like JBoss:

In section 4.4. (Optional configuration properties), be more explicit about what parameters are honored when placed in the hibernate.properties or hibernate.cfg.xml files when running under JBoss or the like. What bit me was the "hibernate.connection.isolation" setting. It was being applied under unit tests, but not in JBoss. It was only a small mention on the org.hibernate.cfg.Environment javadoc page that clued me into the fact that it may not be used in the hosted environment:

Code:
hibernate.connection.isolation     JDBC transaction isolation level (only when using java.sql.DriverManager)


That led me to discover the "transaction-isolation" setting for JBoss datasource files, eg:

Code:
<local-tx-datasource>
....   
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
</local-tx-datasource>


Perhaps I am misunderstanding the root of the problem or this is totally obvious to everyone else. My bad if so. I post this knowing it will cost me a point and may expose how ignorant I am of Hibernate/JBoss configs (you would think I'd have a clue after ~6 months of both), but if it saves some other poor sap from hours of lost time, it's well worth it.

Thanks again for a great tool. Given another few years, I may actually figure out how to use it properly.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 02, 2005 4:28 pm 
Regular
Regular

Joined: Sun May 08, 2005 2:48 am
Posts: 118
Location: United Kingdom
By default all ACID compliant SQL servers use READ_COMMITTED or better. With the 'or better' meaning from a transaction point of view you should be safer at the expense of server transaction optimization and record locking.

There should be a way to query the current isolation level fro your SQL server.

Code:
In MySQL try:

SELECT @@global.tx_isolation;
SELECT @@tx_isolation;


The Hiberation values appear to be:

TRANSACTION_NONE
TRANSACTION_READ_UNCOMMITTED
TRANSACTION_READ_COMMITTED
TRANSACTION_REPEATABLE_READ
TRANSACTION_SERIALIZABLE


Maybe my post is helpful, your actual problem and the statement you are making about the isolation level isn't clear to me.


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