Hi, And thanks for the quick response! :-) Well, I try these setytings, but with batch mode Off, It gives me a java.lang.classCastException. And with Batch mode ON, it gives me a ERROR: Commit on underlying connection failed, try to rollback... These are my xml�s:
Database: <jdbc-connection-descriptor jcd-alias="default" default-connection="true" platform="Oracle" jdbc-level="2.0" driver="oracle.jdbc.driver.OracleDriver" protocol="jdbc" subprotocol="oracle" dbalias="thin:@192.168.0.5:1521:dbserver" username="... password="... eager-release="false" batch-mode="true" useAutoCommit="1" ignoreAutoCommitExceptions="false" > <connection-pool maxActive="5" validationQuery=""/> <sequence-manager className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl" > <attribute attribute-name="autoNaming" attribute-value="false"/> </sequence-manager> And user.xml : <field-descriptor id="1" name="id" column="ID" jdbc-type="INTEGER" nullable="false" primarykey="true" autoincrement="true" sequence-name="SEQ_ANIVER" length="22" /> <field-descriptor name="nome" column="NOME" jdbc-type="VARCHAR" /> <field-descriptor name="nascimento" column="DATA" jdbc-type="DATE" /> </class-descriptor> Thanks.,.. Ronald ----- Original Message ----- From: "Danilo Tommasina" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, October 28, 2003 1:37 PM Subject: Re: Oracle Auto-Increment > hi Ronald (sorry i misspelled your name before) > > As long as i know Oracle has ROW ID fields and I meant you were using > these ones as auto-increment. > > We use Oracle-sequences for Id auto-generation, these must be generated > by your DBAs and you need to know wht is the name of the sequences they > generated. > In your repository.xml you assign sequences to your columns, as follows: > > <field-descriptor > id="1" > name="fieldName" > column="columnName" > jdbc-type="DECIMAL" > nullable="false" > primarykey="true" > autoincrement="true" > sequence-name="SEQUENCE_NAME_FOR_TABLE" > length="22" > /> > > Also add following XML as inner-tag in 'jdbc-descriptor' tag. > > <sequence-manager > className="org.apache.ojb.broker.util.sequence.SequenceManagerNextValImpl"> > <attribute attribute-name="autoNaming" attribute-value="false"/> > </sequence-manager> > > cheers > danilo > > > Hi Danilo, > > > > I will try to explain a little better (forgive the errors... I�m > > brazillian... hehe :-) > > First: I�m not a DB expert. > > The DBA have done the all the sequences. They work perfect outside OJB. > > Well, considering that I have a Oracle Database Setup and OK, with sequences > > and all... right? > > My doubt is on OJB, when I try to use the store() method I get an > > java.lang.ClassCastException. > > Can you send the pieces of the repository_user and repository_database to > > me? > > I think my error is there, because the database is already in use at a long > > time, without problems in a Client/Server application. > > You can do that? > > > > Thanks for the support!!! > > []�s > > > > Ronald > > > > > > ----- Original Message ----- > > From: "Danilo Tommasina" <[EMAIL PROTECTED]> > > To: "OJB Users List" <[EMAIL PROTECTED]> > > Sent: Tuesday, October 28, 2003 12:58 PM > > Subject: Re: Oracle Auto-Increment > > > > > > > >>Hi Roland, > >> > >>using sequences works very well > >> > >>cheers > >>danilo > >> > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Danilo Tommasina, Dipl. Ing. FH Telecom > Software Engineer > RCS Riskmanagement Concepts Systems AG > Technoparkstrasse 1 > CH-8005 Zuerich > T: +41 1 445 29 08 > [EMAIL PROTECTED] > www.risksys.com > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > >
