-->
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: verify major hibernate/oracle bug: (works w/postgres)
PostPosted: Thu Aug 13, 2009 1:58 pm 
Regular
Regular

Joined: Thu Sep 16, 2004 4:56 pm
Posts: 80
JIRA said post here before posting a bug. I have the following test case which is very simple....

Code:
EntityManagerFactory sf = Persistence.createEntityManagerFactory(
      "xcoreNonJta", props);

//put a breakpoint here and
//pull the internet connection after hitting the breakpoint
//then continue the test!!! postgres passes, oracle fails!!

EntityManager mgr = sf.createEntityManager();
mgr.getTransaction().begin();

//since we do nothing, neither commit nor begin will interact
//with the database...isn't hibernate kick ass except when
//used with oracle :(

mgr.getTransaction().commit();
mgr.close();
sf.close();


This test case works GREAT against postgres and does not waste database connection resources by sending data across to the database BUT it fails against oracle. I just tested this on the latest 3.3.2 GA and previously was on 3.3.0.SP1.

Because of this bug, SEAM is not working at all when the oracle database is down or the internet connection to the database is down(ie. the db NIC breaks). It ends up in an infinite redirect.

There are two BUGs really. One is solved by turning autocommit=false in persistence.xml. If you do not do this, mgr.getTransaction().begin() results in a database hit and should NOT. (again, I don't need to set autocommit to false for postgres). Then, once that is set to false, mgr.getTransaction().commit() fails as it hits the database when it does not need to as well.

Is this a hibernate bug? I was just going to report it in JIRA, but it said to report here first.

Lastly, this also means that if using the transaction per http request pattern that seam and nearly everyone else use, oracle is getting a database hit on every single http request even for just plain static seam pages......this I would think is very very bad.
thanks,
Dean

_________________
The list of compelling reasons to reduce the estimate does not include you simply wishing it would take less time - Unknown


Top
 Profile  
 
 Post subject: Re: verify major hibernate/oracle bug: (works w/postgres)
PostPosted: Thu Aug 13, 2009 3:01 pm 
Regular
Regular

Joined: Thu Sep 16, 2004 4:56 pm
Posts: 80
hmmm, is this an oracle driver bug.....is it part of some unwritten JDBC specification that setAutocommit() should not result in a database call until some more real action is taken like persist. I thought hibernate would have more control in the code there to protect from bad JDBC drivers like oracles.

ie. I stepped through the hibernate code and the exact same path is taken for oracle and for postgres. The only difference is oracle ends up hitting the db and postgres does not. This then creates an infinite redirect in seam when the database is down :(.

any thoughts here?
thanks,
Dean

_________________
The list of compelling reasons to reduce the estimate does not include you simply wishing it would take less time - Unknown


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.