-->
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: Hibernate falsely declares no dialect to get next sequence
PostPosted: Mon Sep 03, 2007 11:02 am 
Newbie

Joined: Thu Mar 08, 2007 1:58 pm
Posts: 6
I have been using Hibernate for over a year but upon trying to do something slightly different it all goes to hell. After failing to populate a slightly different table I am resorting to insert statements but need the next sequence. That is failing too.

String sql = org.hibernate.dialect.Dialect.getDialect().getSequenceNextValString(seqName);

gives me

10:55:44,046 ERROR [Log] org.hibernate.HibernateException The dialect was not set. Set the property hibernate.dialect...
org.hibernate.dialect.Dialect.instantiateDialect(Dialect.java
org.hibernate.dialect.Dialect.getDialect(Dialect.java:210)

Now that is pretty annoying because in my config file (which has been fine for a LONG time)

<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>

also if I do a get property just before the sequence it *does* return org.hibernate.dialect.PostgreSQLDialect

so it is a fake error message and so I would have to restore to a bunch of if/else if for every database I need to support.

can you tell I am having a bad day?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 06, 2007 11:56 am 
Expert
Expert

Joined: Sat Jan 17, 2004 2:57 pm
Posts: 329
Location: In the basement in my underwear
Perhaps you're using the wrong mechanism to get the Dialect.

Based on that method you're calling has no usages in the Hibernate code I'm not quite sure what's it's for but it is trying to find the Dialect out of your System properties which hibernate doesn't seem to set.

You will probably have better success if you get the Dialect off of your SessionFactory.

_________________
Some people are like Slinkies - not really good for anything, but you still can't help but smile when you see one tumble down the stairs.


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.