Your settings look good. I use this technique with MS SQL Server and all is working well. Please note which version of OJB you're using. Hopefully, its rc6!

From: "Nilesh" <[EMAIL PROTECTED]>
Reply-To: "OJB Users List" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
CC: <[EMAIL PROTECTED]>
Subject: auto increment not working
Date: Sun, 22 Feb 2004 19:40:34 +0530

In my OJB (using PersistenceBroker ) application auto-increment is not working.

I am using MySQL in which I have also used the auto-increment constraint for the Primarykey ( bigint(20) )


For my database definition i have used the "SequenceManagerNativeImpl"


<sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNativeImpl">
<attribute attribute-name="autoNaming" attribute-value="true"/>
</sequence-manager>



also in the mapping file i have


<class-descriptor class="com.haystack.emailmarketingchoice.member.MemberVO" table="tblMember">

<field-descriptor id="1" name="memberId" column="member_id" jdbc-type="BIGINT" primarykey="true" autoincrement="true" access="readonly" />
------------
------------
</class-descriptor>


i have also tried without the --> access="readonly"

but it generates a new 20 digit "auto-increment" number only for the first insert, for the subsequent inserts it generates the same number and a Duplicate Entry error arises.

I have also tried the following sequence managers

SequenceManagerMySQLImpl
SequenceManagerSeqHiLoImpl

with and without these attributes
  <attribute attribute-name="grabSize" attribute-value="5" />
  <attribute attribute-name="globalSequenceId" attribute-value="true"/>
 <attribute attribute-name="globalSequenceStart" attribute-value="10000"/>



But ALL Failed.
Have any one of you tried this. Please let me know.
Thanks in advance for your interest in my problem.

Regards,
Arjun.







_________________________________________________________________
From must-see cities to the best beaches, plan a getaway with the Spring
Travel Guide! http://special.msn.com/local/springtravel.armx


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to