Shiva, as far as I can tell, this should be fine. Maybe somebody else with a more solid Oracle background can reconfirm this. In addition, you could have a look at the mapping file in src/tests/jdo, as it holds a couple of key generator definitions as needed by the CTF test suite.
Werner -----Ursprüngliche Nachricht----- Von: Shiva P. Kodityala [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 02. August 2005 19:15 An: [email protected] Betreff: RE: [castor-user] DuplicateIdentityException Thanks for that link. I am using Oracle db. It looks like IDENTITY is not for Oracle. I guess I should be using Sequence. Real Name of sequence in Oracle datbase is 'idnseq'. Does my mapping file look like this? <mapping ...> <key-generator name="SEQUENCE" alias="ALIASSEQ"> <param name="sequence" value="idnseq"/> </key-generator> <class name="ClassName" identity="IDN" key-generator="ALIASSEQ" > <field name="IDN" type="integer" > <sql name="IDN" type="integer"/> </field> --- --- -- </class> </mapping> Thanks -----Original Message----- From: Werner Guttmann [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 02, 2005 9:07 AM To: [email protected] Subject: AW: [castor-user] DuplicateIdentityException Shiva, For such situations , please use the IDENTITY key-generator as explaind at http://castor.codehaus.org/key-generator.html Thanks Werner -----Ursprüngliche Nachricht----- Von: Shiva P. Kodityala [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 02. August 2005 17:57 An: [email protected] Betreff: RE: [castor-user] DuplicateIdentityException >From the Castor documentation, this Exception must not be thrown. In my mapping.xml: <class name="ClassName" identity="IDN" key-generator="MAX" > The value of column IDN is, in fact, is autogenerated. That means, if I put the row through sqlplus client, in my insert statement, I do not need to have any column 'IDN'. In that case, what should be key-generator? Do I have to have this key-generator at all? Thanks -----Original Message----- From: Shiva P. Kodityala [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 11:36 AM To: [email protected] Subject: [castor-user] DuplicateIdentityException I am getting this exception once in a while. If I understand it correctly, it is possible in the application I am working in. Two processes process the (different) xml data and put to table simultaneously. Table has primary key which is auto generated (so, not taken from xml). Does DuplicateIdentityException mean that inserts are happening simultaneously and getting the same autogenearted primary key (happening before another's commit)? Fortunately, the application tries (certain number of times) again to insert the same xml, in case of failure, and the insert succeeds. I don't know if it is a good way. Pls advise. Thanks ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] ------------------------------------------------- ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] ------------------------------------------------- ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] ------------------------------------------------- ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] ------------------------------------------------- ------------------------------------------------- If you wish to unsubscribe from this list, please send an empty message to the following address: [EMAIL PROTECTED] -------------------------------------------------

