-->
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.  [ 3 posts ] 
Author Message
 Post subject: Q: Hibernate not honouring customer dialect settings
PostPosted: Tue Jan 30, 2007 10:12 am 
Newbie

Joined: Mon Jan 01, 2007 9:43 pm
Posts: 11
Hibernate version: 3.2.2 GA

I'm writing a customer dialect for an obscure database but it would appear Hibernate is not honouring my attempts to block all ForUpdate capabilities.

ODBC trace
---snip---
mysql-connector 4c88-480c EXIT SQLPrepare with return code -1 (SQL_ERROR)
HSTMT 033C27A8
UCHAR * 0x0092C330 [ -3] "select CustomerID from Customers for update\ 0"
---snip---

MYOBdialect.java
---snip--

public boolean supportsForUpdate() {
return false;
}

public boolean supportsForUpdateOf() {
return false;
}

public boolean forUpdateOfColumns() {
return false;
}

public boolean supportsOuterJoinForUpdate() {
return false;
}

public boolean supportsForUpdateNowait() {
return false;
}

---snip---

Any thoughts on this?
Thanks in advance!
Adam


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 30, 2007 12:04 pm 
Beginner
Beginner

Joined: Mon Jan 22, 2007 1:16 pm
Posts: 21
maybe try adding this to your dialect

public String getForUpdateString() {
return "";
}


the original method in the Dialect.java class is

public String getForUpdateString() {
return " for update";
}


if this doesn't stop Hibernate from adding 'for update' then maybe Hibernate is not using your dialect. in the Hibernate log you should see this line

INFO: Using dialect: ***name of your dialect here***


good luck

-mark


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 31, 2007 1:06 am 
Newbie

Joined: Mon Jan 01, 2007 9:43 pm
Posts: 11
I've included that - thanks! Its definately picking up my custom dialect and working happily now.

I think a locking feature was being called and writing the string in question, I've now changed from <generator class="native"/> to "<generator class="assigned"/> and this no longer calls this method.

Adam


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