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.  [ 1 post ] 
Author Message
 Post subject: default autoguess dialect to use 9i when oracle detected
PostPosted: Thu Sep 03, 2009 12:44 pm 
Newbie

Joined: Thu Sep 03, 2009 12:28 pm
Posts: 1
Hi there - I did a search but received a lot of results that didn't look like what I was looking for so hopefully someone can help me out. Our company has several products. One of these products uses hibernate and only supports postgresql(A). Another product supports both oracle and postgresql but performs better with oracle.(B)

For product (B) we were setting the hibernate dialect as a jvm property in the glassfish admin page so that we could ship one EAR that worked with either database. For some reason our dba wants hibernate to use the oracle 9i dialect instead of trying to use newer ones if a newer oracle is detected. Anyhow this seemed to work well.

For product (A) we were setting the dialect in the persistance.xml for the ear - and it was checked in and built with postgresql since that is the only db currently supported.


I got put in a situation where we wanted to run both apps in one container with (A) pointing to postgresql and (B) pointing to oracle - it took me a while to figure out that Oracle dialect was being used even in application (A) and causing failures.

Since we're running JEE 5 I've been banging my head against the wall trying to figure out how to programatically set the dialect at app startup - basically if db = oracle(anyversion) use dialect oracle9i, else use postgres. I haven't arrived at a good method although JEE 6 with singleton @startup looks promising when it shows up. However in the meantime, is there any way I can configure hibernate to prefer a specific dialect for a given database type? If so I could turn off the explicit setting because Hibernate would see oracle or postgress and choose appropriately.....again the main sticking point is we wanted consistant behavior so I need it to default to 9i if it sees oracle, even if oracle 11 is actually there.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.