Re: Problem Inserting with Hibernate

David Botterill <[email protected]> Sat, 21 May 2005 21:50:03 -0600
Newsgroups gmane.comp.db.mckoi
Message-ID <[email protected]>
I finally worked the problem out.  It turns out I had to get a new 
session each time I refreshed my DataFactory (Not to be confused with 
the Hibernate SessionFactory)..  Perhaps my "SessionHelper" is incorrect. 

Well, thanks for the input.  It's working now.

-David

James wrote:

>It's been a couple of days and no-one has offered any
>help.  So, foolishly I'll try.
>
>I have used Hibernate Mckoi combination with success. 
>It has been my experience that any problems are
>usually solved by making changes in the mapping files
>and not in the code itself.  
>
>Are you using the same Academy.hbm.xml file for Mckoi
>as you were for Access--i.e. without change?   
>
>You say one insert works.  Sounds like you are trying
>to use same primary key in two different inserts. 
>Where do the primary keys come from in Access?  In
>Mckoi, you have sequences.  I suspect some
>modification of your hbm file is in order.
>
>here is a typical id entry in my hbm files.
>
>    <id name="id" 
>        column="xxxxxx_ID"
>        type="long"
>        unsaved-value="0" >
>      <generator class="sequence">
>        <param
>name="sequence">APP.hibernate_sequence</param>
>      </generator>
>    </id>
>
>I use a single sequence defined in APP schema for all
>tables in database instance.
>
>Hope this gives you some clues as to where to make
>adjustments in mapping files.
>
>Best Regards, Jim
>
>
>
>---------------------------------------------------------------
>Mckoi SQL Database mailing list  http://www.mckoi.com/database/
>To unsubscribe, send a message to [email protected]
>
>
>
>
>  
>


---------------------------------------------------------------
Mckoi SQL Database mailing list  http://www.mckoi.com/database/
To unsubscribe, send a message to [email protected]
david.vcf (text/x-vcard, 134 B)
begin:vcard
fn:David Botterill
n:;David Botterill
email;internet:[email protected]
x-mozilla-html:TRUE
version:2.1
end:vcard