-->
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: Hilo id mapping with MS Access
PostPosted: Wed Jun 08, 2005 11:53 pm 
Newbie

Joined: Wed Jun 08, 2005 11:42 pm
Posts: 4
I am new to nHibernate and I am having trouble getting the id mapped using Access as a backend, no choice on the db. I am using the generic dialect and connecting through oledb. I have the ID mapped as follows:

<id name="Id" column="FacultyId" type="Int64" >
<generator class="hilo">
<param hame="table">Keys</param>
<param name="column">FacultyId</param>
<param name="max_lo">100</param>
</generator>
</id>

I have a corresponding table set up named Keys with a single column name FacultyId. When I try to save the object I get the following error:

005-06-08 21:45:34,747 [2828] ERROR NHibernate.Id.TableGenerator [] [] - could not read a hi value
Exception: System.Data.OleDb.OleDbException
Message: Syntax error in FROM clause.
Source: Microsoft JET Database Engine

Any suggestions, I can't figure out how to log the SQL commands that are being issued either?

TIA!!

NCW


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jun 12, 2005 4:49 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
SQL issued by the hilo generator isn't currently logged. But what it's doing is "select next_hi from table" with "for update" appended for dialects that support it. GenericDialect is marked as supporting "for update", so this is probably the problem. Try using some MsSql dialect, or if you can, get Access dialect from the Web (either JIRA or Confluence, I don't remember where it was) and use that.


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.