Re: PB vs. ODMG
Thanks Armin. We're setting up our test databases right now. I'll let you know how we make out. Cheers, --Corey __ William C. Brown Chief Architect. Spectrum Software Inc. 11445 Johns Creek Pkwy Duluth, GA. 30097. Suite 300. Tel > 770.813.4952 e > [EMAIL PROTECTED] web > www.spectrumscm.com yahoo > caldron68 - Original Message - From: "Armin Waibel" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Tuesday, May 25, 2004 4:09 AM Subject: Re: PB vs. ODMG > Hi Corey, > > Corey wrote: > > Hi all, > > > > Sorry, newbie posting here. I've read all the docs and played with all of > > the tutorials, but now I need some advice. The question is whether to code > > directly to the PB or to code to ODMG or JDO. > > PB api is stable and no major bugs are known (latest CVS). All top-level > api use the PB-kernel to work. PB api is very flexible. > ODMG api implementation nearly stable some known issues (some issues > with m:n relation handling, restore of of object state - hope to fix > this in next 2 weeks) > JDO, current implementation is a plugin to the SUN JDO Reference > Implementation. Work on a native implementation has started (first > version is scheduled for 1.1 or 1.2). > > > I'm attracted to the simplicity > > of the PB but am concerned about the management of 1:n or m:n relationships > > between objects. The documentation indicates that when using the PB, the > > relationships > > between collections of objects would need to resolved manually using the link() > > and unlink() calls. > > This is not correct. You can do all relation handling by hand using > linking (or set all FK by your own) with PB-api, but it is also possible > to let OJB do all linking stuff automatic. This depends on the used > auto-xxx setting > http://db.apache.org/ojb/tutorial3.html#Setting%20Load,%20Update,%20and%20Delete%20Cascading > With PB-api all is possible ;-) > > regards, > Armin > > > The document also seems to indicate that this would not be > > the case if ODMG were employed. Can anyone iterate over the good, bad and > > ugly of one method verses the other? Looking for the voice of experience here. > > > > Thanks > > --Corey > > __ > > William C. Brown > > Chief Architect. Spectrum Software Inc. > > > > 11445 Johns Creek Pkwy > > Duluth, GA. 30097. > > Suite 300. > > Tel > 770.813.4952 > > e > [EMAIL PROTECTED] > > web > www.spectrumscm.com > > yahoo > caldron68 > > > > - Original Message - > > From: "Rajani" <[EMAIL PROTECTED]> > > To: "OJB Users List" <[EMAIL PROTECTED]> > > Sent: Monday, May 24, 2004 7:30 AM > > Subject: Problem reading a clob object > > > > > > > >>Hi All, > >> > >> I'm using oracle 8i database. > >> The table has a column with the data-type as CLOB which we are using to > >>store xml data. > >> It is mapped to String data type in the java object. > >> I have no problem inserting xml data with this mapping. But when i try > >>to fetch the record using persistence broker, Its failing to retrieve the > >>data. > >> Can anybody throw some light on this problem? > >> > >>Thanks > >>Rajani > >> > > > > > > > > > > - > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PB vs. ODMG
Hi Corey, Corey wrote: Hi all, Sorry, newbie posting here. I've read all the docs and played with all of the tutorials, but now I need some advice. The question is whether to code directly to the PB or to code to ODMG or JDO. PB api is stable and no major bugs are known (latest CVS). All top-level api use the PB-kernel to work. PB api is very flexible. ODMG api implementation nearly stable some known issues (some issues with m:n relation handling, restore of of object state - hope to fix this in next 2 weeks) JDO, current implementation is a plugin to the SUN JDO Reference Implementation. Work on a native implementation has started (first version is scheduled for 1.1 or 1.2). I'm attracted to the simplicity of the PB but am concerned about the management of 1:n or m:n relationships between objects. The documentation indicates that when using the PB, the relationships between collections of objects would need to resolved manually using the link() and unlink() calls. This is not correct. You can do all relation handling by hand using linking (or set all FK by your own) with PB-api, but it is also possible to let OJB do all linking stuff automatic. This depends on the used auto-xxx setting http://db.apache.org/ojb/tutorial3.html#Setting%20Load,%20Update,%20and%20Delete%20Cascading With PB-api all is possible ;-) regards, Armin The document also seems to indicate that this would not be the case if ODMG were employed. Can anyone iterate over the good, bad and ugly of one method verses the other? Looking for the voice of experience here. Thanks --Corey __ William C. Brown Chief Architect. Spectrum Software Inc. 11445 Johns Creek Pkwy Duluth, GA. 30097. Suite 300. Tel > 770.813.4952 e > [EMAIL PROTECTED] web > www.spectrumscm.com yahoo > caldron68 - Original Message - From: "Rajani" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, May 24, 2004 7:30 AM Subject: Problem reading a clob object Hi All, I'm using oracle 8i database. The table has a column with the data-type as CLOB which we are using to store xml data. It is mapped to String data type in the java object. I have no problem inserting xml data with this mapping. But when i try to fetch the record using persistence broker, Its failing to retrieve the data. Can anybody throw some light on this problem? Thanks Rajani - 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]
Re: PB vs. ODMG
http://db.apache.org/ojb/faq.html#What%20are%20the%20differences%20between%20the%20PersistenceBroker%20API%20and%20the%20ODMG%20API?%20Which%20one%20should%20I%20use%20in%20my%20applications? Corey wrote: Hi all, Sorry, newbie posting here. I've read all the docs and played with all of the tutorials, but now I need some advice. The question is whether to code directly to the PB or to code to ODMG or JDO. I'm attracted to the simplicity of the PB but am concerned about the management of 1:n or m:n relationships between objects. The documentation indicates that when using the PB, the relationships between collections of objects would need to resolved manually using the link() and unlink() calls. The document also seems to indicate that this would not be the case if ODMG were employed. Can anyone iterate over the good, bad and ugly of one method verses the other? Looking for the voice of experience here. Thanks --Corey __ William C. Brown Chief Architect. Spectrum Software Inc. 11445 Johns Creek Pkwy Duluth, GA. 30097. Suite 300. Tel > 770.813.4952 e > [EMAIL PROTECTED] web > www.spectrumscm.com yahoo > caldron68 - Original Message - From: "Rajani" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, May 24, 2004 7:30 AM Subject: Problem reading a clob object Hi All, I'm using oracle 8i database. The table has a column with the data-type as CLOB which we are using to store xml data. It is mapped to String data type in the java object. I have no problem inserting xml data with this mapping. But when i try to fetch the record using persistence broker, Its failing to retrieve the data. Can anybody throw some light on this problem? Thanks Rajani - 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]
PB vs. ODMG
Hi all, Sorry, newbie posting here. I've read all the docs and played with all of the tutorials, but now I need some advice. The question is whether to code directly to the PB or to code to ODMG or JDO. I'm attracted to the simplicity of the PB but am concerned about the management of 1:n or m:n relationships between objects. The documentation indicates that when using the PB, the relationships between collections of objects would need to resolved manually using the link() and unlink() calls. The document also seems to indicate that this would not be the case if ODMG were employed. Can anyone iterate over the good, bad and ugly of one method verses the other? Looking for the voice of experience here. Thanks --Corey __ William C. Brown Chief Architect. Spectrum Software Inc. 11445 Johns Creek Pkwy Duluth, GA. 30097. Suite 300. Tel > 770.813.4952 e > [EMAIL PROTECTED] web > www.spectrumscm.com yahoo > caldron68 - Original Message - From: "Rajani" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, May 24, 2004 7:30 AM Subject: Problem reading a clob object > Hi All, > > I'm using oracle 8i database. > The table has a column with the data-type as CLOB which we are using to > store xml data. > It is mapped to String data type in the java object. > I have no problem inserting xml data with this mapping. But when i try > to fetch the record using persistence broker, Its failing to retrieve the > data. > Can anybody throw some light on this problem? > > Thanks > Rajani > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PB vs ODMG
Hello, I am bit confused about this ... 1 - using the PB and setting auto-update="true", is the entire object graph stored in one transaction? (it was my understanding that it was). 2 - similarly, using the PB with auto-delete="true" is the delete performed in one transaction? 3 - using ODMG is it ok to set auto-delete="true", so that the entire object graph is deleted? When I try it, it works fine, but the docs indicate not to deviate from the default settings (which would include auto-delete="false") when using ODMG. Thanks Bob c Bob Celestino SAS Research and Development 919 - 531 - 9425 [EMAIL PROTECTED] SAS - The Power to Know > -Original Message- > From: Mahler Thomas [mailto:[EMAIL PROTECTED] > Sent: Friday, November 14, 2003 7:18 AM > To: 'OJB Users List' > Subject: RE: PB vs ODMG > > > Hi Gary, > > > Is there information available as to why one must not > > use auto-update with ODMG? > > The difference between PB/ODMG regarding auto-update is > documented here: > http://db.apache.org/ojb/tutorial3.html#setting%20load-,%20u > pdate-%20and%20d > elete-cascading > > The reason for this is simple. > ODMG provides transparent persistence for complete Objects > graphs. If an Object A is locked by an ODMG transaction, > all associated objects get also registered into the transaction. > > If a change to such an associated objects happens within > the transaction, the ODMG transaction mager is responsible > to detect it and to perform the appropriate PB calls to make the. > > If you set auto-update to true the PB performs store > operations for all elements of an 1:n association on > storing the 1-side instance. > > So if you use ODMG *and* auto-update="true" persistence > operations like inserts and updates will be performed > twice. In case of inserts this may lead to primary key violations. > > cheers, > thomas > > > > > > Thanks, Gary > > > > --- Robert J Celestino <[EMAIL PROTECTED]> > > wrote: > > > Thomas, > > > > > > Thanks very much. I am very happy with the PB api, > > > and prefer the query style so I will be happy to > > > stick with PB. Until I switch to JDO :-) > > > > > > You were right about the "auto-update" as well. > > > > > > Thanks! > > > Bob c > > > > > > > > > > > Bob Celestino > > > SAS Research and Development > > > 919 - 531 - 9425 > > > [EMAIL PROTECTED] > > > > > > SAS - The Power to Know > > > > > > > > > > -Original Message- > > > > From: Mahler Thomas > > > [mailto:[EMAIL PROTECTED] > > > > Sent: Thursday, November 13, 2003 4:05 AM > > > > To: 'OJB Users List' > > > > Subject: RE: PB vs ODMG > > > > > > > > > > > > Hi Roberto, > > > > > > > > > Hello, > > > > > > > > > > My understanding that the ODMG API is > > > preferred over the > > > > > PersistenceBroker in production. > > > > > > > > The PB API is quite mature and it's absolutely > > > fine to use > > > > it in production. The ODMG API is build on top > > > of PB. So > > > > how could the ODMG API be "better" for > > > production? > > > > > > > > It really depends on your API requirements if > > > you chosse > > > > PB, ODMG, OTM or JDO as your API. If you feel > > > fine with the > > > > PB API there is no reason not to use it in > > > production. > > > > > > > > > To that end I have been > > > > > converting a fair amount of code (that is > > > currently working > > > > > using the PersistenceBroker API) to the ODMG > > > API. > > > > > > > > > > The code works perfectly using the PB API. So > > > I assume that > > > > > the mappings and configurations are correct. > > > > > > > > There are some subtle differences
RE: PB vs ODMG
Hi Gary, > Is there information available as to why one must not > use auto-update with ODMG? The difference between PB/ODMG regarding auto-update is documented here: http://db.apache.org/ojb/tutorial3.html#setting%20load-,%20update-%20and%20d elete-cascading The reason for this is simple. ODMG provides transparent persistence for complete Objects graphs. If an Object A is locked by an ODMG transaction, all associated objects get also registered into the transaction. If a change to such an associated objects happens within the transaction, the ODMG transaction mager is responsible to detect it and to perform the appropriate PB calls to make the. If you set auto-update to true the PB performs store operations for all elements of an 1:n association on storing the 1-side instance. So if you use ODMG *and* auto-update="true" persistence operations like inserts and updates will be performed twice. In case of inserts this may lead to primary key violations. cheers, thomas > Thanks, Gary > > --- Robert J Celestino <[EMAIL PROTECTED]> > wrote: > > Thomas, > > > > Thanks very much. I am very happy with the PB api, > > and prefer the query style so I will be happy to > > stick with PB. Until I switch to JDO :-) > > > > You were right about the "auto-update" as well. > > > > Thanks! > > Bob c > > > > > > > Bob Celestino > > SAS Research and Development > > 919 - 531 - 9425 > > [EMAIL PROTECTED] > > > > SAS - The Power to Know > > > > > > > -Original Message- > > > From: Mahler Thomas > > [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, November 13, 2003 4:05 AM > > > To: 'OJB Users List' > > > Subject: RE: PB vs ODMG > > > > > > > > > Hi Roberto, > > > > > > > Hello, > > > > > > > > My understanding that the ODMG API is > > preferred over the > > > > PersistenceBroker in production. > > > > > > The PB API is quite mature and it's absolutely > > fine to use > > > it in production. The ODMG API is build on top > > of PB. So > > > how could the ODMG API be "better" for > > production? > > > > > > It really depends on your API requirements if > > you chosse > > > PB, ODMG, OTM or JDO as your API. If you feel > > fine with the > > > PB API there is no reason not to use it in > > production. > > > > > > > To that end I have been > > > > converting a fair amount of code (that is > > currently working > > > > using the PersistenceBroker API) to the ODMG > > API. > > > > > > > > The code works perfectly using the PB API. So > > I assume that > > > > the mappings and configurations are correct. > > > > > > There are some subtle differences in the mapping > > of > > > Reference and collection descriptors. You must > > not use > > > auto-update="true" in an ODMG based app! > > > > > > > > > > > The simplest case that I can describe is this: > > > > > > > > > > > > omdg = OJB.getInstance() ; > > > > db = _omdg.newDatabase() ; > > > > db.open( "default", > > Database.OPEN_READ_WRITE); > > > > Transaction tx = omdg.newTransaction() ; > > > > Person person = new Person() ; // creates > > default with > > > > default addr, etc > > > > tx.begin() ; > > > > tx.lock( person, Transaction.WRITE ) ; > > > > tx.commit() ; < throws SQL Exception > > > > > > > > The exception that is thrown is "duplicate > > entry for key" > > > > (note the table is empty) > > > > > > > > I did write my own SequenceManger. But it > > works flawlessly > > > > using the PB API. > > > > > > > > The corresponding code (that works) is here: > > > > // include the user and password here: > > > > PBKey pbKey = new PBKey( "default" ) ; > > > > broker = > > > > > > > PersistenceBrokerFactory.createPersistenceBroker(pbKey); > > > > // 1. open transaction > > > &g
RE: PB vs ODMG
Is there information available as to why one must not use auto-update with ODMG? Thanks, Gary --- Robert J Celestino <[EMAIL PROTECTED]> wrote: > Thomas, > > Thanks very much. I am very happy with the PB api, > and prefer the query style so I will be happy to > stick with PB. Until I switch to JDO :-) > > You were right about the "auto-update" as well. > > Thanks! > Bob c > > > Bob Celestino > SAS Research and Development > 919 - 531 - 9425 > [EMAIL PROTECTED] > > SAS - The Power to Know > > > > -Original Message- > > From: Mahler Thomas > [mailto:[EMAIL PROTECTED] > > Sent: Thursday, November 13, 2003 4:05 AM > > To: 'OJB Users List' > > Subject: RE: PB vs ODMG > > > > > > Hi Roberto, > > > > > Hello, > > > > > > My understanding that the ODMG API is > preferred over the > > > PersistenceBroker in production. > > > > The PB API is quite mature and it's absolutely > fine to use > > it in production. The ODMG API is build on top > of PB. So > > how could the ODMG API be "better" for > production? > > > > It really depends on your API requirements if > you chosse > > PB, ODMG, OTM or JDO as your API. If you feel > fine with the > > PB API there is no reason not to use it in > production. > > > > > To that end I have been > > > converting a fair amount of code (that is > currently working > > > using the PersistenceBroker API) to the ODMG > API. > > > > > > The code works perfectly using the PB API. So > I assume that > > > the mappings and configurations are correct. > > > > There are some subtle differences in the mapping > of > > Reference and collection descriptors. You must > not use > > auto-update="true" in an ODMG based app! > > > > > > > > The simplest case that I can describe is this: > > > > > > > > > omdg = OJB.getInstance() ; > > > db = _omdg.newDatabase() ; > > > db.open( "default", > Database.OPEN_READ_WRITE); > > > Transaction tx = omdg.newTransaction() ; > > > Person person = new Person() ; // creates > default with > > > default addr, etc > > > tx.begin() ; > > > tx.lock( person, Transaction.WRITE ) ; > > > tx.commit() ; < throws SQL Exception > > > > > > The exception that is thrown is "duplicate > entry for key" > > > (note the table is empty) > > > > > > I did write my own SequenceManger. But it > works flawlessly > > > using the PB API. > > > > > > The corresponding code (that works) is here: > > > // include the user and password here: > > > PBKey pbKey = new PBKey( "default" ) ; > > > broker = > > > > PersistenceBrokerFactory.createPersistenceBroker(pbKey); > > > // 1. open transaction > > > broker.beginTransaction(); > > > // 2. make the new object persistent > > > broker.store( person ) ; > > > broker.commitTransaction(); > > > > > > More information: > > > If I comment out the reference-descriptor and > > > collection-descriptor in the > repository_user.xml the store > > > works (but of course I get no relationships). > However the > > > update does not work. If I change the name of > the person and > > > store it again the database is not updated. > > > > try to set auto-update="false" in the > reference-descriptor > > and collection-descriptor > > > > cheers, > > Thomas > > > > > > > > I must be missing something ... > > > > > > Thanks > > > Bob c > > > > > > > > > > Bob Celestino > > > SAS Research and Development > > > 919 - 531 - 9425 > > > [EMAIL PROTECTED] > > > > > > SAS - The Power to Know > > > > > > > > > > > - > > > 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] > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __ Do you Yahoo!? Protect your identity with Yahoo! Mail AddressGuard http://antispam.yahoo.com/whatsnewfree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PB vs ODMG
Thomas, Thanks very much. I am very happy with the PB api, and prefer the query style so I will be happy to stick with PB. Until I switch to JDO :-) You were right about the "auto-update" as well. Thanks! Bob c Bob Celestino SAS Research and Development 919 - 531 - 9425 [EMAIL PROTECTED] SAS - The Power to Know > -Original Message- > From: Mahler Thomas [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 13, 2003 4:05 AM > To: 'OJB Users List' > Subject: RE: PB vs ODMG > > > Hi Roberto, > > > Hello, > > > > My understanding that the ODMG API is preferred over the > > PersistenceBroker in production. > > The PB API is quite mature and it's absolutely fine to use > it in production. The ODMG API is build on top of PB. So > how could the ODMG API be "better" for production? > > It really depends on your API requirements if you chosse > PB, ODMG, OTM or JDO as your API. If you feel fine with the > PB API there is no reason not to use it in production. > > > To that end I have been > > converting a fair amount of code (that is currently working > > using the PersistenceBroker API) to the ODMG API. > > > > The code works perfectly using the PB API. So I assume that > > the mappings and configurations are correct. > > There are some subtle differences in the mapping of > Reference and collection descriptors. You must not use > auto-update="true" in an ODMG based app! > > > > > The simplest case that I can describe is this: > > > > > > omdg = OJB.getInstance() ; > > db = _omdg.newDatabase() ; > > db.open( "default", Database.OPEN_READ_WRITE); > > Transaction tx = omdg.newTransaction() ; > > Person person = new Person() ; // creates default with > > default addr, etc > > tx.begin() ; > > tx.lock( person, Transaction.WRITE ) ; > > tx.commit() ; < throws SQL Exception > > > > The exception that is thrown is "duplicate entry for key" > > (note the table is empty) > > > > I did write my own SequenceManger. But it works flawlessly > > using the PB API. > > > > The corresponding code (that works) is here: > > // include the user and password here: > > PBKey pbKey = new PBKey( "default" ) ; > > broker = > > PersistenceBrokerFactory.createPersistenceBroker(pbKey); > > // 1. open transaction > > broker.beginTransaction(); > > // 2. make the new object persistent > > broker.store( person ) ; > > broker.commitTransaction(); > > > > More information: > > If I comment out the reference-descriptor and > > collection-descriptor in the repository_user.xml the store > > works (but of course I get no relationships). However the > > update does not work. If I change the name of the person and > > store it again the database is not updated. > > try to set auto-update="false" in the reference-descriptor > and collection-descriptor > > cheers, > Thomas > > > > > I must be missing something ... > > > > Thanks > > Bob c > > > > > > Bob Celestino > > SAS Research and Development > > 919 - 531 - 9425 > > [EMAIL PROTECTED] > > > > SAS - The Power to Know > > > > > > - > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PB vs ODMG
Hi Roberto, > Hello, > > My understanding that the ODMG API is preferred over the > PersistenceBroker in production. The PB API is quite mature and it's absolutely fine to use it in production. The ODMG API is build on top of PB. So how could the ODMG API be "better" for production? It really depends on your API requirements if you chosse PB, ODMG, OTM or JDO as your API. If you feel fine with the PB API there is no reason not to use it in production. > To that end I have been > converting a fair amount of code (that is currently working > using the PersistenceBroker API) to the ODMG API. > > The code works perfectly using the PB API. So I assume that > the mappings and configurations are correct. There are some subtle differences in the mapping of Reference and collection descriptors. You must not use auto-update="true" in an ODMG based app! > > The simplest case that I can describe is this: > > > omdg = OJB.getInstance() ; > db = _omdg.newDatabase() ; > db.open( "default", Database.OPEN_READ_WRITE); > Transaction tx = omdg.newTransaction() ; > Person person = new Person() ; // creates default with > default addr, etc > tx.begin() ; > tx.lock( person, Transaction.WRITE ) ; > tx.commit() ; < throws SQL Exception > > The exception that is thrown is "duplicate entry for key" > (note the table is empty) > > I did write my own SequenceManger. But it works flawlessly > using the PB API. > > The corresponding code (that works) is here: > // include the user and password here: > PBKey pbKey = new PBKey( "default" ) ; > broker = > PersistenceBrokerFactory.createPersistenceBroker(pbKey); > // 1. open transaction > broker.beginTransaction(); > // 2. make the new object persistent > broker.store( person ) ; > broker.commitTransaction(); > > More information: > If I comment out the reference-descriptor and > collection-descriptor in the repository_user.xml the store > works (but of course I get no relationships). However the > update does not work. If I change the name of the person and > store it again the database is not updated. try to set auto-update="false" in the reference-descriptor and collection-descriptor cheers, Thomas > > I must be missing something ... > > Thanks > Bob c > > > Bob Celestino > SAS Research and Development > 919 - 531 - 9425 > [EMAIL PROTECTED] > > SAS - The Power to Know > > - > 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]
PB vs ODMG
Hello, My understanding that the ODMG API is preferred over the PersistenceBroker in production. To that end I have been converting a fair amount of code (that is currently working using the PersistenceBroker API) to the ODMG API. The code works perfectly using the PB API. So I assume that the mappings and configurations are correct. The simplest case that I can describe is this: omdg = OJB.getInstance() ; db = _omdg.newDatabase() ; db.open( "default", Database.OPEN_READ_WRITE); Transaction tx = omdg.newTransaction() ; Person person = new Person() ; // creates default with default addr, etc tx.begin() ; tx.lock( person, Transaction.WRITE ) ; tx.commit() ; < throws SQL Exception The exception that is thrown is "duplicate entry for key" (note the table is empty) I did write my own SequenceManger. But it works flawlessly using the PB API. The corresponding code (that works) is here: // include the user and password here: PBKey pbKey = new PBKey( "default" ) ; broker = PersistenceBrokerFactory.createPersistenceBroker(pbKey); // 1. open transaction broker.beginTransaction(); // 2. make the new object persistent broker.store( person ) ; broker.commitTransaction(); More information: If I comment out the reference-descriptor and collection-descriptor in the repository_user.xml the store works (but of course I get no relationships). However the update does not work. If I change the name of the person and store it again the database is not updated. I must be missing something ... Thanks Bob c Bob Celestino SAS Research and Development 919 - 531 - 9425 [EMAIL PROTECTED] SAS - The Power to Know - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]