objectbridge-developers Mailing List for ObJectRelationalBridge (Page 50)
Brought to you by:
thma
You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(14) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(33) |
Feb
(8) |
Mar
(3) |
Apr
(1) |
May
(18) |
Jun
(6) |
Jul
(15) |
Aug
(71) |
Sep
(29) |
Oct
(43) |
Nov
(77) |
Dec
(54) |
2002 |
Jan
(54) |
Feb
(147) |
Mar
(144) |
Apr
(163) |
May
(307) |
Jun
(240) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: Mahler T. <tho...@it...> - 2001-09-26 06:52:02
|
Hi, As I see it IS NULL is currently not supported. Neither by my OQL implementation nor by the PersistenceBroker Query mechanism. I added this as an urgent feature request... Thanks for your patience with OJB... --Thomas > -----Urspr=FCngliche Nachricht----- > Von: Charles Anthony [mailto:cha...@hp...] > Gesendet: Montag, 24. September 2001 16:05 > An: 'obj...@li...' > Betreff: [Objectbridge-developers] Searching for null columns with = OQL >=20 >=20 > Hi once again, >=20 > I wish to do a search for a null column; how can I do this in OQL ? >=20 > I tried "Select aBalance from test.Balance where=20 > balanceEndDate is null", > and this produced a parse error. I dug around, and found that=20 > the parser > doesn't know anything about "is" or "null", but it knew about=20 > something > called 'nil' >=20 > So I tried "Select aBalance from test.Balance where=20 > balanceEndDate =3D nil", > which at least was a valid query; it didn't give the expected=20 > result though. > The generated SQL was=20 >=20 > "SELECT Balance_ID, Account_Id, balanceStartDate, balanceEndDate, > openingBalance, balance FROM Balance WHERE balanceEndDate=3D null" >=20 > Is it possible to generate "SELECT Balance_ID, Account_Id,=20 > balanceStartDate, > balanceEndDate, openingBalance, balance FROM Balance WHERE=20 > balanceEndDate is > null" from an OQL query ? >=20 > Thankyou once more, >=20 > Charles. >=20 >=20 > This email and any attachments are strictly confidential and=20 > are intended > solely for the addressee. If you are not the intended=20 > recipient you must > not disclose, forward, copy or take any action in reliance on=20 > this message > or its attachments. If you have received this email in error=20 > please notify > the sender as soon as possible and delete it from your=20 > computer systems. > Any views or opinions presented are solely those of the=20 > author and do not > necessarily reflect those of HPD Software Limited or its affiliates. >=20 > At present the integrity of email across the internet cannot=20 > be guaranteed > and messages sent via this medium are potentially at risk. =20 > All liability > is excluded to the extent permitted by law for any claims=20 > arising as a re- > sult of the use of this medium to transmit information by or to=20 > HPD Software Limited or its affiliates. >=20 >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Mahler T. <tho...@it...> - 2001-09-26 06:43:42
|
> -----Urspr=FCngliche Nachricht----- > Von: Christian Sell [mailto:chr...@ne...] > Gesendet: Dienstag, 25. September 2001 20:16 > An: Mahler Thomas > Betreff: Re: [Objectbridge-developers] Order of commit in ODMG > transaction >=20 >=20 > >The only thing that will help you right now is to drop the=20 > foreign key > >constraints in the RDBMS. > >If you are forced to use fk constraints please tell me: I'll put = this > >feature to the top of my todo list! But it will take at=20 > least 1 week as I > >want to get out the next release this week. >=20 > Instead of dropping the FK constraints (what an ugly=20 > proposition), some > databases (e.g., Oracle 8.x) support deferred constraint checking for > transactions, meaning that constraints are not checked until the = final > commit of the transaction. >=20 > regards, Christian >=20 |
From: Mahler T. <tho...@it...> - 2001-09-26 06:43:36
|
Hi all, attached you'll find my current todo list and a change log since the last public release. I'll post this list once a week or so to keep you updated. I hope to make the OJB development process more transparent this way and get you informed on what is going on. I choose this way and not the SourceForge TaskManager as I find it not handy to use. Let me know what you think about this. --Thomas |
From: Mahler T. <tho...@it...> - 2001-09-25 15:05:05
|
Hi Rainer, > -----Urspr=FCngliche Nachricht----- > Von: Bischof, Rainer [mailto:rai...@ed...] > Gesendet: Dienstag, 25. September 2001 16:53 > An: 'obj...@li...' > Betreff: [Objectbridge-developers] Automated deletion of depending > objects > Wichtigkeit: Hoch >=20 >=20 > Hi Thomas, >=20 > somewhere I have read that OJB supports automated deletion of=20 > depending > objects in a 1-m relationship. The question is: how do I do that? >=20 > I have an object which contains a Vector of depending=20 > objects. I want to > delete one of these. So I just open a transaction, get a=20 > handle to the main > object and remove one of the depending objects from the Vector. On > transaction submit I would expect that OJB removes the=20 > corresponding row in > the table. >=20 > This does not happen for me ;-( > Mapping has "true" entries for automated retrieval, update=20 > and delete. Do I > need to use an ODMG collection instead of the Vector? >=20 Yes, you need object level transactions that come only with ODMG ! See excerpt from the FAQ: Say you use the PB to query an object O that has a collection attribute = col with five elements a,b,c,d,e. Next you delete Objects d and e from col = and store O again with PersistenceBroker.store(O); PB will store the remaining objects a,b,c. But it will NOT delete d and = e ! If you then requery object O it will again contain a,b,c,d,e !!!=20 The PB keeps no transactional state of the persistent Objects, thus it = does not know that d and e have to be deleted. (as a side note: deletion of = d and e could also be an error, as there might be references to them from = other objects !!!) Using ODMG for the above scenario will eliminate all trouble: Objects = are registered to a transaction so that on commit of the transaction it = knows that d and e do not longer belong to the collection. the ODMG = collection will not delete the objects d and e but only the REFERENCES from the collection to those objects! > Thanks > Rainer >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Bischof, R. <rai...@ed...> - 2001-09-25 14:53:11
|
Hi Thomas, somewhere I have read that OJB supports automated deletion of depending objects in a 1-m relationship. The question is: how do I do that? I have an object which contains a Vector of depending objects. I want to delete one of these. So I just open a transaction, get a handle to the main object and remove one of the depending objects from the Vector. On transaction submit I would expect that OJB removes the corresponding row in the table. This does not happen for me ;-( Mapping has "true" entries for automated retrieval, update and delete. Do I need to use an ODMG collection instead of the Vector? Thanks Rainer |
From: Charles A. <cha...@hp...> - 2001-09-25 12:51:31
|
Hi Thomas, I have dropped my constraints for the time-being, in order to get = things going. It would be very useful to have an idea of what is on the to-do list, = and an idea of what is in the next release... the task-list at SourceForge = seems as though it may be rather out of date.. What would be very useful indeed would be a 'roadmap', showing what = features you may be planning for what release. These are, of course, a little time-consuming and frequently become rapidly out of date. I must say, though, I am very impressed with the code in the project; = it's clarity and simplicity is superb.=20 With thanks, Charles. > -----Original Message----- > From: Mahler Thomas [mailto:tho...@it...] > Sent: 25 September 2001 13:39 > To: 'Charles Anthony'; = 'obj...@li...' > Subject: AW: [Objectbridge-developers] Order of commit in ODMG > transaction >=20 >=20 > Hi again Charles, >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Charles Anthony [mailto:cha...@hp...] > > Gesendet: Dienstag, 25. September 2001 11:47 > > An: 'obj...@li...' > > Betreff: [Objectbridge-developers] Order of commit in ODMG=20 > transaction > >=20 > >=20 > > Hello, > >=20 > > I have objects AccountingTransaction and AccountingEntry.=20 > > There is a one to > > many relationship between the Transaction and Entry. This is=20 > > backed up by a > > foreign-key constraint in the database. > >=20 >=20 > Ooops: Proper handling of fk-constraints is definetly not=20 > supported yet :-( >=20 >=20 > > I want to be able to commit the Transactions and Entries=20 > > within the same > > (ODMG) transaction (so that either all or none are created in=20 > > the database). > >=20 > > Unfortunately, it seems that sometimes the AccountEntry gets=20 > > created before > > the AccountTransaction within the database transaction of the=20 > > commit, thus > > violating the foreign key constraint. > >=20 > > After a quick look at the sourcecode, it seems that the=20 > > ObjectStateTable > > stores the ObjectTransactionWrapper's in a hashtable, and=20 > > that on Commit, > > the ObjectTransactionWrapper's are processed in hashtable order. > >=20 > > Whilst I'm not sure this classifies as a bug, it would be an=20 > > immense benefit > > to have the objects committed in order; it shouldn't be too=20 > > difficult to > > store the objects order in a Vector (or similar) on the=20 > > ObjectStateTable, > > and process the Vector on commit. > >=20 >=20 > I (as a lazy programmer) won't classify it as a bug: it's=20 > merely a feature > that is not yet implemented yet. We will need a depency graph=20 > to determine > the right processing order. It should be not too difficult to=20 > generate such > a graph from the metadata. I'll put it on my my todo list! >=20 >=20 > > I am sure I'm missing something pretty obvious here; I'm not=20 > > sure what it is > > though. > >=20 > > Is there any chance of a solution to this problem ? > >=20 >=20 > The only thing that will help you right now is to drop the foreign = key > constraints in the RDBMS. > If you are forced to use fk constraints please tell me: I'll put this > feature to the top of my todo list! But it will take at least=20 > 1 week as I > want to get out the next release this week. >=20 > --Thomas >=20 > > With many thanks, > >=20 > > Charles. > >=20 > >=20 > > This email and any attachments are strictly confidential and=20 > > are intended > > solely for the addressee. If you are not the intended=20 > > recipient you must > > not disclose, forward, copy or take any action in reliance on=20 > > this message > > or its attachments. If you have received this email in error=20 > > please notify > > the sender as soon as possible and delete it from your=20 > > computer systems. > > Any views or opinions presented are solely those of the=20 > > author and do not > > necessarily reflect those of HPD Software Limited or its = affiliates. > >=20 > > At present the integrity of email across the internet cannot=20 > > be guaranteed > > and messages sent via this medium are potentially at risk. =20 > > All liability > > is excluded to the extent permitted by law for any claims=20 > > arising as a re- > > sult of the use of this medium to transmit information by or to=20 > > HPD Software Limited or its affiliates. > >=20 > >=20 > >=20 > > _______________________________________________ > > Objectbridge-developers mailing list > > Obj...@li... > > = https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 This email and any attachments are strictly confidential and are = intended solely for the addressee. If you are not the intended recipient you = must not disclose, forward, copy or take any action in reliance on this = message or its attachments. If you have received this email in error please = notify the sender as soon as possible and delete it from your computer = systems. Any views or opinions presented are solely those of the author and do = not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be = guaranteed and messages sent via this medium are potentially at risk. All = liability is excluded to the extent permitted by law for any claims arising as a = re- sult of the use of this medium to transmit information by or to=20 HPD Software Limited or its affiliates. |
From: Mahler T. <tho...@it...> - 2001-09-25 12:40:22
|
Hi again Charles, > -----Urspr=FCngliche Nachricht----- > Von: Charles Anthony [mailto:cha...@hp...] > Gesendet: Dienstag, 25. September 2001 11:47 > An: 'obj...@li...' > Betreff: [Objectbridge-developers] Order of commit in ODMG = transaction >=20 >=20 > Hello, >=20 > I have objects AccountingTransaction and AccountingEntry.=20 > There is a one to > many relationship between the Transaction and Entry. This is=20 > backed up by a > foreign-key constraint in the database. >=20 Ooops: Proper handling of fk-constraints is definetly not supported yet = :-( > I want to be able to commit the Transactions and Entries=20 > within the same > (ODMG) transaction (so that either all or none are created in=20 > the database). >=20 > Unfortunately, it seems that sometimes the AccountEntry gets=20 > created before > the AccountTransaction within the database transaction of the=20 > commit, thus > violating the foreign key constraint. >=20 > After a quick look at the sourcecode, it seems that the=20 > ObjectStateTable > stores the ObjectTransactionWrapper's in a hashtable, and=20 > that on Commit, > the ObjectTransactionWrapper's are processed in hashtable order. >=20 > Whilst I'm not sure this classifies as a bug, it would be an=20 > immense benefit > to have the objects committed in order; it shouldn't be too=20 > difficult to > store the objects order in a Vector (or similar) on the=20 > ObjectStateTable, > and process the Vector on commit. >=20 I (as a lazy programmer) won't classify it as a bug: it's merely a = feature that is not yet implemented yet. We will need a depency graph to = determine the right processing order. It should be not too difficult to generate = such a graph from the metadata. I'll put it on my my todo list! > I am sure I'm missing something pretty obvious here; I'm not=20 > sure what it is > though. >=20 > Is there any chance of a solution to this problem ? >=20 The only thing that will help you right now is to drop the foreign key constraints in the RDBMS. If you are forced to use fk constraints please tell me: I'll put this feature to the top of my todo list! But it will take at least 1 week as = I want to get out the next release this week. --Thomas > With many thanks, >=20 > Charles. >=20 >=20 > This email and any attachments are strictly confidential and=20 > are intended > solely for the addressee. If you are not the intended=20 > recipient you must > not disclose, forward, copy or take any action in reliance on=20 > this message > or its attachments. If you have received this email in error=20 > please notify > the sender as soon as possible and delete it from your=20 > computer systems. > Any views or opinions presented are solely those of the=20 > author and do not > necessarily reflect those of HPD Software Limited or its affiliates. >=20 > At present the integrity of email across the internet cannot=20 > be guaranteed > and messages sent via this medium are potentially at risk. =20 > All liability > is excluded to the extent permitted by law for any claims=20 > arising as a re- > sult of the use of this medium to transmit information by or to=20 > HPD Software Limited or its affiliates. >=20 >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Mahler T. <tho...@it...> - 2001-09-25 12:17:02
|
Hi Satish, > -----Urspr=FCngliche Nachricht----- > Von: sa...@na... [mailto:sa...@na...] > Gesendet: Dienstag, 25. September 2001 00:38 > An: tho...@it... > Betreff: Re: AW: [Fwd: broker instance vs Connection instance] >=20 >=20 > Hi Thomas, >=20 > Thanks for your response. >=20 > I setup a test wherein I get a new broker instance each time > and do a query with it. I expected a new JDBC connection each > time. However, I notice that the same connection is being used > for the same statement. I came to this conclusion because: >=20 > 1. mysql> show processlist does not show any new threads. >=20 > 2. A new ConnectionManager is getting created (as expected) > but getNewConnection is not getting called. >=20 > I will look into it some more tonight. >=20 This is really strange. I'll have a look at it too! (As a side note: did you have any problems in getting started with OJB against mysql? Can you send me a sample JDBC ConnectionDescription to include it in the default XM repository?!)=20 > On a different note, > I am thinking of encouraging a friend of mine to use OJB for thanks ! > doing BMP in EJB (with Orion server) based on the proxying=20 > and cacheing, server-side pooling of PersistenceBrokers > capabilities of OJB. At the same time, I realize > that SQL join queries cannot be done yet with OJB. >=20 ... yes, they are still waiting on my todo list...=20 > What are your thoughts on this. Do you think it is ready > to be used in serious EJB apps? Basically, I am not an > EJB expert and I was wondering if there are any obvious > limitations to be aware of at this time. >=20 I have been using OJB under IBM WebSphere and it worked great. I also implemented support for EJB Finder methods in OJB (PkEnumeration). = There is a sample how to use OJB with BMP managed entity beans in package test.ojb.ejb. OJB does not support CMP. I also have no intention to do this in the = future! There are several things that could be problematic with the 0.5.155 = release and EJB: 1. no Support for JNDI lookup of DataSources and Connections. (Will be included in the next release) 2. OJB 0.5.155 does not integrate in the Accesscontrol configuration of = the EJB Container (e.g. access to private Attributes via Reflection). The = next release will do this. HTH, Thomas > Thanks very much, > Satish. >=20 > On Mon, 24 Sep 2001 13:11:06 +0200 Mahler Thomas=20 > <tho...@it...> wrote: > >Hi Satish, > > > >> -------- Original Message -------- > >> Subject: broker instance vs Connection instance > >> Date: 23 Sep 2001 19:36:28 -0000 > >> From: sa...@na... > >> To: tho...@ho... > >>=20 > >> Hi Thomas, > >>=20 > >> I am a little confused with the behavior I am noticing: > >>=20 > >> Basically, it seems that the same JDBC Connection object can > >> be used by different broker instances. My (probably incorrect) > >> assumption was that a (physical) JDBC Connection is not shared > >> between broker instances. > >>=20 > >> I have been looking around the code and I notice that > >>=20 > >> StatementManager.getStatementsForClass() creates new=20 > >> StatementsForClass > >> object if not already in its statementTable. > >>=20 > >> So, if broker1 is used to get conn1 and hence stmt1, then=20 > later on the > >> same query (stmt1) will use conn1 even if broker2 is used to do = the > >> query. > >> conn2 is not created in this case. > >>=20 > >> Is this the desired behavior? I guess I do not understand the > >> relationship > >> between PersistenceBroker and actual JDBC connection. > >>=20 > >Thanks for you careful examination. > >The connections must be used exclusively for one broker to maintain > >transactional integrity. > > > >Each PersistenceBrokerImpl has a ConnectionManager that=20 > holds a table of > >connections exclusively for this broker. StatementsForClass needs > >connections to create JDBC Statements. StatementsForClass=20 > uses the broker's > >ConnectionManager to obtain connections. > > > >I had a look at the code and could no defect in this=20 > depencies, so there > >should be no conflicts... > > > > > >-- Thomas > > > > > >> Thanks, > >> Satish. > >>=20 > >> --=20 > >> Get your firstname@lastname email for FREE at=20 > >http://Nameplanet.com/?su > > >=20 >=20 > --=20 > Get your firstname@lastname email for FREE at=20 http://Nameplanet.com/?su |
From: Mahler T. <tho...@it...> - 2001-09-25 11:58:07
|
Hi Aurelije, Thanks for your interest, > -------- Original Message -------- > Subject: ObJectRelationalBridge > Date: Mon, 24 Sep 2001 15:48:54 -0700 > From: "Aurelije Zovko" <az...@ma...> > Reply-To: <az...@ma...> > To: <tho...@ho...> > > Hi Thomas, > > My name is Aurelije Zovko. I am working for Maranti Networks, storage > company. I have used TopLink in my previous project. I am > using CocoBase > right know, and I am not satisfied . TopLink is to expensive. > So an open > source mapping code will be an alternative. > I really appreciate TOPLink. There is more than a decade of experience in it and it's full of very good features. Of course it's really expensive. If it's too expensive depends largely on your budget ;-) > When do your relational bridge will be ready for commercial use? > How stable is software? > Did anyone used it in commercial development? > Of course a release number like 0.5.x does not sound like a mature product. But in my eyes OJB is quite stable and reliable. It's the only open source O/R tool that is scalable (it has a concept similar to TOPLinks ServerSession and RemoteSession). There are also several projects using it for production level applications. See the OpenEMed project (http://sourceforge.net/projects/openmed/) as a reference user. On the other hand: OJB is still under development and a lot of things that you can taken for granted with TOPLink are not finished for OJB. My advice: Build a technical prototype of your application that covers the persistence needs and see if OJB fits your needs. Feature requests and bug reports are always welcome ! best regards, Thomas > Regards, > Aurelije > > Aurelije Zovko > Maranti Networks > Principal Software Eng. > 920 Hillview Ct., Ste 280, Milpitas, CA 95035 > > Phone: 408.719.9600 ext.343 > Fax: 408.719.9631 > E-mail: az...@ma... > |
From: Charles A. <cha...@hp...> - 2001-09-25 09:49:35
|
Hello, I have objects AccountingTransaction and AccountingEntry. There is a one to many relationship between the Transaction and Entry. This is backed up by a foreign-key constraint in the database. I want to be able to commit the Transactions and Entries within the same (ODMG) transaction (so that either all or none are created in the database). Unfortunately, it seems that sometimes the AccountEntry gets created before the AccountTransaction within the database transaction of the commit, thus violating the foreign key constraint. After a quick look at the sourcecode, it seems that the ObjectStateTable stores the ObjectTransactionWrapper's in a hashtable, and that on Commit, the ObjectTransactionWrapper's are processed in hashtable order. Whilst I'm not sure this classifies as a bug, it would be an immense benefit to have the objects committed in order; it shouldn't be too difficult to store the objects order in a Vector (or similar) on the ObjectStateTable, and process the Vector on commit. I am sure I'm missing something pretty obvious here; I'm not sure what it is though. Is there any chance of a solution to this problem ? With many thanks, Charles. This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |
From: Bischof, R. <rai...@ed...> - 2001-09-24 14:10:25
|
Thomas, I strongly support this request although its too late for our project = ;-( This manual coding introduces a new point of failure where simple typos = can cause you hours to identify: You have a persistent object with = references that looses it's references when re-loaded from the DB. The first thing = you do is check your mapping file but you will probably not check the = setter methods for the ID and reference IDs.=20 Thanks Rainer Bischof > -----Original Message----- > From: Mahler Thomas [mailto:tho...@it...] > Sent: Montag, 24. September 2001 15:48 > To: 'Charles Anthony' > Cc: Objectbridge (E-Mail); Tom (E-Mail) > Subject: AW: [Objectbridge-developers] Object References >=20 >=20 > Hi Anthony, >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Charles Anthony [mailto:cha...@hp...] > > Gesendet: Montag, 24. September 2001 12:11 > > An: 'obj...@li...' > > Betreff: [Objectbridge-developers] Object References > >=20 > >=20 > > Hi, > >=20 > > I have an Agreement object and an AgreementType object. > > Agreement has a reference to Agreement type. > >=20 > > In the database, the field agreementType_id (mapped to=20 > > agreementTypeId) > > cannot be null i.e. an agreement must have an agreement type. > >=20 > > public class Agreement { > >=20 > > private BigDecimal id; > > private BigDecimal agreementTypeId; > > private AgreementType agreementType; > >=20 > > I have accessor methods (get+set) for id and agreementType,=20 > > but not for > > agreementTypeId - I don't really want the developer to have=20 > > to set this > > exlicitly, unless absolutely necessary. > >=20 > > I instantiated a new Agreement, set the id and the=20 > > agreementType fields to > > be valid objects, I expected OJB to be smart and populate the > > agreementTypeId for me from the agreementType reference. It=20 > > didn't, hence I > > got a SQL error=20 > >=20 >=20 > OJB is clever, but not that clever yet ;-) >=20 > > "Cannot insert the value NULL into column 'AgreementType_ID', table > > 'AccountingProto.dbo.Agreement'; column does not allow nulls.=20 > > INSERT fails." > >=20 > > Can/does OJB do this for me, or do I have to set the=20 > > agreementTypeId myself > > ? > >=20 > As of today OJB does NOT handle this automatically: you have to fill > foreignkey attributes in your client app. Of course you can=20 > hide this from > the application developer. But I agree that it would be a=20 > good feature to > have OJB handle this stuff automatically. >=20 > I will place this as a new feature request on my todo list! >=20 > --Thomas >=20 >=20 > >=20 > > This email and any attachments are strictly confidential and=20 > > are intended > > solely for the addressee. If you are not the intended=20 > > recipient you must > > not disclose, forward, copy or take any action in reliance on=20 > > this message > > or its attachments. If you have received this email in error=20 > > please notify > > the sender as soon as possible and delete it from your=20 > > computer systems. > > Any views or opinions presented are solely those of the=20 > > author and do not > > necessarily reflect those of HPD Software Limited or its = affiliates. > >=20 > > At present the integrity of email across the internet cannot=20 > > be guaranteed > > and messages sent via this medium are potentially at risk. =20 > > All liability > > is excluded to the extent permitted by law for any claims=20 > > arising as a re- > > sult of the use of this medium to transmit information by or to=20 > > HPD Software Limited or its affiliates. > >=20 > >=20 > >=20 > > _______________________________________________ > > Objectbridge-developers mailing list > > Obj...@li... > > = https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Charles A. <cha...@hp...> - 2001-09-24 14:07:21
|
Hi once again, I wish to do a search for a null column; how can I do this in OQL ? I tried "Select aBalance from test.Balance where balanceEndDate is null", and this produced a parse error. I dug around, and found that the parser doesn't know anything about "is" or "null", but it knew about something called 'nil' So I tried "Select aBalance from test.Balance where balanceEndDate = nil", which at least was a valid query; it didn't give the expected result though. The generated SQL was "SELECT Balance_ID, Account_Id, balanceStartDate, balanceEndDate, openingBalance, balance FROM Balance WHERE balanceEndDate= null" Is it possible to generate "SELECT Balance_ID, Account_Id, balanceStartDate, balanceEndDate, openingBalance, balance FROM Balance WHERE balanceEndDate is null" from an OQL query ? Thankyou once more, Charles. This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |
From: Mahler T. <tho...@it...> - 2001-09-24 13:48:45
|
Hi Anthony, > -----Urspr=FCngliche Nachricht----- > Von: Charles Anthony [mailto:cha...@hp...] > Gesendet: Montag, 24. September 2001 12:11 > An: 'obj...@li...' > Betreff: [Objectbridge-developers] Object References >=20 >=20 > Hi, >=20 > I have an Agreement object and an AgreementType object. > Agreement has a reference to Agreement type. >=20 > In the database, the field agreementType_id (mapped to=20 > agreementTypeId) > cannot be null i.e. an agreement must have an agreement type. >=20 > public class Agreement { >=20 > private BigDecimal id; > private BigDecimal agreementTypeId; > private AgreementType agreementType; >=20 > I have accessor methods (get+set) for id and agreementType,=20 > but not for > agreementTypeId - I don't really want the developer to have=20 > to set this > exlicitly, unless absolutely necessary. >=20 > I instantiated a new Agreement, set the id and the=20 > agreementType fields to > be valid objects, I expected OJB to be smart and populate the > agreementTypeId for me from the agreementType reference. It=20 > didn't, hence I > got a SQL error=20 >=20 OJB is clever, but not that clever yet ;-) > "Cannot insert the value NULL into column 'AgreementType_ID', table > 'AccountingProto.dbo.Agreement'; column does not allow nulls.=20 > INSERT fails." >=20 > Can/does OJB do this for me, or do I have to set the=20 > agreementTypeId myself > ? >=20 As of today OJB does NOT handle this automatically: you have to fill foreignkey attributes in your client app. Of course you can hide this = from the application developer. But I agree that it would be a good feature = to have OJB handle this stuff automatically. I will place this as a new feature request on my todo list! --Thomas >=20 > This email and any attachments are strictly confidential and=20 > are intended > solely for the addressee. If you are not the intended=20 > recipient you must > not disclose, forward, copy or take any action in reliance on=20 > this message > or its attachments. If you have received this email in error=20 > please notify > the sender as soon as possible and delete it from your=20 > computer systems. > Any views or opinions presented are solely those of the=20 > author and do not > necessarily reflect those of HPD Software Limited or its affiliates. >=20 > At present the integrity of email across the internet cannot=20 > be guaranteed > and messages sent via this medium are potentially at risk. =20 > All liability > is excluded to the extent permitted by law for any claims=20 > arising as a re- > sult of the use of this medium to transmit information by or to=20 > HPD Software Limited or its affiliates. >=20 >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 |
From: Mahler T. <tho...@it...> - 2001-09-24 11:56:39
|
Hi Satish, > > Hi Thomas, > > I will do that right away. Thank you!! > > I noticed another problem. Basically, if the database is > down when I do a query using PersistenceBroker, I do not > get a PersistenceBroker exception. It seems that the SQL > exceptions are caught and handled but not rethrown. At the > app layer, It makes it very hard to report errors or do > any error handling. For example, a broker.getCollectionByQuery > will return an empty iterator. So, for the app, it seems like > there are no elements that match the query in db. > In it's early days OJB caught most exceptions. There are still places where exceptions are not properly reached to the client app. I will have a code walkthrough to improve this situation. > Hope my feedback is useful and doesn't sound like whining. As always: thanks for your carefull observance. Each reported bug will improve OJB so it's definitely useful! thanks, Thomas > > Thank you, > Satish. > > > On Wed, 01 Jan 1997 01:07:56 +0100 Thomas Mahler > <tho...@ho...> wrote: > >Hi Satish, > >sa...@na... wrote: > >> > >> Hi Thomas, > >> > >> I have been noticing that lots of JDBC connections were getting > >> created for simple queries using the same broker instance. > >> > >> Then I noticed that new ConnectionManager > >> instances were getting created for each query using the same broker > >> instance. I inserted some debug statements and I think I might be > >> seeing a bug. > >> > >> Basically, since the connectionTable is empty for a new > ConnectionManager > >> (created in StatementsForClass), getNewConnection is called in > >> ConnectionManager. Also curious is why the > connectionManager object in > >> PersistenceBroker was not being used? > >> > >> I haven't had the time to put together a simple case that > you can use. > >> But, if you need, I will do so. > >> > >> Please let me know. > >> > >> If you do have a fix for this, can you mail it to me since > I need to get > >> this software out as soon as possible. > >> > >Yes, this is definitely a bug. Sascha reported it some days ago and I > >already prepared a fix. > >As I did a lot of other internal changes in the meantime > that won't be > >compatible to your sources I can't send you the patched files. > >But fortunately it's not difficult to do: > >1. provide PersistenceBrokerImpl with a public method > >getConnectionManager(): > >public ConnectionManager getConnectionManager() > >{ > > return m_ConnectionManager; > >} > > > >2. in the StamentsForClass constructor change the line > > ConnectionManager manager = new ConnectionManager(broker); > > > >to: > > > > ConnectionManager manager = broker.getConnectionManager(); > > > >3. That's it! > > > >> Also, did you get a chance to look at my previous email regarding > >> mysql wait_timeouts on idle connections and hence you can > be left with > >> stale connections in the pool (the server pool). > >> > > > >Yes, but it's not easy to simulate this behaviour with instantdb. I > >assume that the method java.sql.Connection.isClosed() will > return true > >or throws an SQLException in this case. > >I will write some code that will use isClosed() to check if the > >connection is still valid and will acquire a fresh one if > necessary. The > >fix will be in the next release. (by the end of the week) > > > >HTH, > > > >Thomas > > > >> Thanks for all your help, > >> Satish. > >> > >> -- > >> Get your firstname@lastname email for FREE at http://Nameplanet.com/?su > > -- Get your firstname@lastname email for FREE at http://Nameplanet.com/?su |
From: Mahler T. <tho...@it...> - 2001-09-24 11:52:04
|
Hi Satish, > -------- Original Message -------- > Subject: broker instance vs Connection instance > Date: 23 Sep 2001 19:36:28 -0000 > From: sa...@na... > To: tho...@ho... > > Hi Thomas, > > I am a little confused with the behavior I am noticing: > > Basically, it seems that the same JDBC Connection object can > be used by different broker instances. My (probably incorrect) > assumption was that a (physical) JDBC Connection is not shared > between broker instances. > > I have been looking around the code and I notice that > > StatementManager.getStatementsForClass() creates new > StatementsForClass > object if not already in its statementTable. > > So, if broker1 is used to get conn1 and hence stmt1, then later on the > same query (stmt1) will use conn1 even if broker2 is used to do the > query. > conn2 is not created in this case. > > Is this the desired behavior? I guess I do not understand the > relationship > between PersistenceBroker and actual JDBC connection. > Thanks for you careful examination. The connections must be used exclusively for one broker to maintain transactional integrity. Each PersistenceBrokerImpl has a ConnectionManager that holds a table of connections exclusively for this broker. StatementsForClass needs connections to create JDBC Statements. StatementsForClass uses the broker's ConnectionManager to obtain connections. I had a look at the code and could no defect in this depencies, so there should be no conflicts... -- Thomas > Thanks, > Satish. > > -- > Get your firstname@lastname email for FREE at http://Nameplanet.com/?su |
From: Charles A. <cha...@hp...> - 2001-09-24 10:14:02
|
Hi, I have an Agreement object and an AgreementType object. Agreement has a reference to Agreement type. In the database, the field agreementType_id (mapped to agreementTypeId) cannot be null i.e. an agreement must have an agreement type. public class Agreement { private BigDecimal id; private BigDecimal agreementTypeId; private AgreementType agreementType; I have accessor methods (get+set) for id and agreementType, but not for agreementTypeId - I don't really want the developer to have to set this exlicitly, unless absolutely necessary. I instantiated a new Agreement, set the id and the agreementType fields to be valid objects, I expected OJB to be smart and populate the agreementTypeId for me from the agreementType reference. It didn't, hence I got a SQL error "Cannot insert the value NULL into column 'AgreementType_ID', table 'AccountingProto.dbo.Agreement'; column does not allow nulls. INSERT fails." Can/does OJB do this for me, or do I have to set the agreementTypeId myself ? This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |
From: Thomas M. <tho...@ho...> - 2001-09-23 09:01:54
|
Hi Satish, sa...@na... wrote: > > Hi Thomas, > > I have been noticing that lots of JDBC connections were getting > created for simple queries using the same broker instance. > > Then I noticed that new ConnectionManager > instances were getting created for each query using the same broker > instance. I inserted some debug statements and I think I might be > seeing a bug. > > Basically, since the connectionTable is empty for a new ConnectionManager > (created in StatementsForClass), getNewConnection is called in > ConnectionManager. Also curious is why the connectionManager object in > PersistenceBroker was not being used? > > I haven't had the time to put together a simple case that you can use. > But, if you need, I will do so. > > Please let me know. > > If you do have a fix for this, can you mail it to me since I need to get > this software out as soon as possible. > Yes, this is definitely a bug. Sascha reported it some days ago and I already prepared a fix. As I did a lot of other internal changes in the meantime that won't be compatible to your sources I can't send you the patched files. But fortunately it's not difficult to do: 1. provide PersistenceBrokerImpl with a public method getConnectionManager(): public ConnectionManager getConnectionManager() { return m_ConnectionManager; } 2. in the StamentsForClass constructor change the line ConnectionManager manager = new ConnectionManager(broker); to: ConnectionManager manager = broker.getConnectionManager(); 3. That's it! > Also, did you get a chance to look at my previous email regarding > mysql wait_timeouts on idle connections and hence you can be left with > stale connections in the pool (the server pool). > Yes, but it's not easy to simulate this behaviour with instantdb. I assume that the method java.sql.Connection.isClosed() will return true or throws an SQLException in this case. I will write some code that will use isClosed() to check if the connection is still valid and will acquire a fresh one if necessary. The fix will be in the next release. (by the end of the week) HTH, Thomas > Thanks for all your help, > Satish. > > -- > Get your firstname@lastname email for FREE at http://Nameplanet.com/?su |
From: Thomas M. <tho...@ho...> - 2001-09-21 15:38:22
|
Hi Charles, Right now the XML FieldDescriptors MUST be in the same sequence as the COLUMNS of the underlying table. AND their ids must match the column-number. I.e. the first descriptor must map on column one and have the id 1. The nth descriptor must map on column n and must have id n. But you have discovered a little inconsistency: for inserts the exact numbering is currently not checked. I will fix this inconsistency. After this fix the descriptors must only have an ID matching the column number. HTH, Thomas Charles Anthony wrote: > > Hi All, > > I'm beginning to play about using OJB with some of my own classes and > tables, and I seem to be getting some bizarre behaviour; it seems that > setting an attribute on a class tries to modify a different column on the > database than is specified in the mapping file. This only seems to happen on > an update, not on an insert. > > It seems that the order of FieldDescriptors in the file is significant; and > possibly the id attribute of the FieldDesciptor. > > I think perhaps I might be able to dig a little more out about whats going > on if I understood how OJB uses the mapping file; does it cross-reference > the column in the file with the field on the class by > a) name ? > b) position of the FieldDescriptor in the file with the position of the > field in the class (e.g. the first FieldDescriptor->first declared field in > the class) ? > c) id of the FieldDescriptor in the file with the position of the field in > the class (e.g. <FieldDescriptor id="1"> ->first declared field in the > class) ? > d) Something else ? > > a) would seem to me to be the best way of doing it, but I don't think this > is the way it is done. > > Any help would be welcomed, > > With thanks, > > Charles > > This email and any attachments are strictly confidential and are intended > solely for the addressee. If you are not the intended recipient you must > not disclose, forward, copy or take any action in reliance on this message > or its attachments. If you have received this email in error please notify > the sender as soon as possible and delete it from your computer systems. > Any views or opinions presented are solely those of the author and do not > necessarily reflect those of HPD Software Limited or its affiliates. > > At present the integrity of email across the internet cannot be guaranteed > and messages sent via this medium are potentially at risk. All liability > is excluded to the extent permitted by law for any claims arising as a re- > sult of the use of this medium to transmit information by or to > HPD Software Limited or its affiliates. > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Charles A. <cha...@hp...> - 2001-09-21 10:22:42
|
Hi All, I'm beginning to play about using OJB with some of my own classes and tables, and I seem to be getting some bizarre behaviour; it seems that setting an attribute on a class tries to modify a different column on the database than is specified in the mapping file. This only seems to happen on an update, not on an insert. It seems that the order of FieldDescriptors in the file is significant; and possibly the id attribute of the FieldDesciptor. I think perhaps I might be able to dig a little more out about whats going on if I understood how OJB uses the mapping file; does it cross-reference the column in the file with the field on the class by a) name ? b) position of the FieldDescriptor in the file with the position of the field in the class (e.g. the first FieldDescriptor->first declared field in the class) ? c) id of the FieldDescriptor in the file with the position of the field in the class (e.g. <FieldDescriptor id="1"> ->first declared field in the class) ? d) Something else ? a) would seem to me to be the best way of doing it, but I don't think this is the way it is done. Any help would be welcomed, With thanks, Charles This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. |
From: Thomas M. <tho...@ho...> - 2001-09-18 18:12:43
|
Hi Michael, thanks for your interest and your suggestions! Michal Kleczek wrote: > > Hi, > I downloaded ObjectBridge recently and I really like it; > I just have a couple of suggestions: > 1. Creating db connection > There could be ConnectionFactory interface defined so that I could provide > my own implementation looking for connection using JNDI. > This is quite important for me since I'd like to use OJB in J2EE > environment. I agree this is an important feature. I will make the ConnectionFactory pluggable so that you can implement your JNDI Version. I will include the fix in the next release (i hope to get it out within 1 or 2 weeks). I'm interested in your JNDI based implementation. Would you mind to contribute it ince it is finished? We could include it in the OJB Codebase. > 2. Reflection. > Calls to Field.set() or Field.get() should be encapsulated. > In current version setAccessible(true) is called once during repository file > parsing > - so the field is accessible everywhere (not only in OJB)!!!. > Additionally call to setAccesible() is not wrapped > by AccessController.doPrivileged() > so the whole application using OJB has to have "suppressAccessCheck" > privilege. Yes, my hack won't behave in controlled environments! Do you have sample code or a link to some information how to do these things properly? Of course I want to integrate OJB smoothly in J2EE environments. > 3. For convinience the virtual proxy architecture could be changed so that > it uses JDK 1.3 dynamic proxies. > I have been thinking of this too, but there are so many priority 1 topics on my list, that it will take some time... a question: Will you use EntityBeans? If so, did you have a look at the OJB EJB sample in package test.ojb.ejb ? It contains my suggestion for using OJB for BMP EntityBeans. best regards, --Thomas > Michal Kleczek > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com |
From: Thomas M. <tho...@ho...> - 2001-09-15 11:58:13
|
Hi Rainer, Thanks for your interest in OJB. You have a lot of questions, so I thought you might be interested in the FAQ page that I'm currently preparing. (see attached html file). What do you think about my idea regarding using the OJB C/S instead of the slow DRDA solution? I did some performance comparison of the new OS390 JDBC/SQLJ Drivers, which were quite promising. We reimplemented some COBOL batch jobs in Java using JDBC. The Java Version (running in the OS390 Unix Services Environment) was half as fast as the Cobol programs. With some further optimizations (JDK 1.3 with HotSPot compilation or using HPJ native compilation) the performance will come quite close to Cobol. I have also been thinking about exposing the PersistenceBrokerServer not as a standalone service but running it as a Servlet within the WebSphere Environment under OS390. So only the ServletEngine and not a proprietary process must be administrated. If this could be helpful for you please let me know. Regarding pluggable Cache and SequenceManager: I've started working on making them pluggable. This will be part of the next release (within next 2 weeks). -- Thomas |
From: Mahler T. <tho...@it...> - 2001-09-06 07:49:18
|
Hi David, > -----Urspr=FCngliche Nachricht----- > Von: David Esposito [mailto:esp...@ne...] > Gesendet: Donnerstag, 6. September 2001 00:24 > An: obj...@li... > Betreff: [Objectbridge-developers] transaction not committing? >=20 >=20 > Howdy all, >=20 > I have an interesting problem ... I have used some of the=20 > sample code in > tutorial1 to make my own sample application. Using=20 > PersistenceBroker, I'm > trying to create records in a table that has only 2 fields=20 > (the PK and a > text field) ... It seems like it's working because i'm=20 > getting new uniqueIDs > from the broker.getUniqueId() call, but when I look in the=20 > DB, nothing has > been created in my table, nor have any records been created=20 > in the obj_seq > table ... here's a trimmed down version of what I'm doing ... >=20 > I'm using Postgres 7.1.2 (and the corresponding JDBC driver)=20 > and i'm using > the latest OJB (0.5.155) .. >=20 > SQL Schema >=20 > create table color( > color_id int not null primary key, > name varchar(100) not null > ); >=20 > in REPOSITORY.XML >=20 > <ClassDescriptor id=3D"7"> > <class.name>schema.Color</class.name> > <table.name>color</table.name> > <FieldDescriptor id=3D"1"> > <field.name>colorID</field.name> > <column.name>color_id</column.name> > <jdbc_type>INTEGER</jdbc_type> > <PrimaryKey>true</PrimaryKey> > </FieldDescriptor> > <FieldDescriptor id=3D"2"> > <field.name>name</field.name> > <column.name>name</column.name> > <jdbc_type>VARCHAR</jdbc_type> > </FieldDescriptor> > </ClassDescriptor> >=20 > JAVA application: >=20 > public myMethod() > { >=20 > public static final String[] colorList =3D > {"Red","Yellow","Green","Purple","Black"}; >=20 > broker =3D=20 > PersistenceBrokerFactory.createPersistenceBroker("repository.xml"); >=20 > broker.beginTransaction(); >=20 > for(int i=3D0; i<colorList.length; i++) > { > Color color =3D new Color(); > color.setName(colorList[i]); > color.setColorID(new=20 > Integer(broker.getUniqueId(Color.class,"colorID"))); >=20 > broker.store(color); >=20 > log("Created new Color with ID: " + color.getColorID()); > } >=20 > broker.commitTransaction(); >=20 > } >=20 > the OUTPUT from myMethod: >=20 > Created new Color with ID: 1 > Created new Color with ID: 2 > Created new Color with ID: 3 > Created new Color with ID: 4 > Created new Color with ID: 5 >=20 >=20 > Has anyone heard of such a thing? It's as if the transaction=20 > isn't committed > to the DB ... If i start another instance of this application=20 > while one is > running, it hangs until the first one is killed, so that=20 > usually means that > there is an uncommitted transaction hanging around ... >=20 This is really kinda strange! Your code looks good and SHOULD work! The only thing I can imagine is a problem with the JDBC driver. You could try to ommit the broker.beginTransaction() and broker.commitTransaction() calls, to check whether it works with JDBC AUtoCommit enabled. A different approach to check if the problems are due to OJB-PostGres incompatibility is to run your example against the shipped instantDB. If it runs with instantDB we will have to have a deeper look at the Postgres JDBC-driver... =20 Have you tried to run the unmodified Tutorial1 against PostGres? HTH, Thomas > -Dave >=20 >=20 >=20 > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers >=20 ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com ********************************************************************** |
From: David E. <esp...@ne...> - 2001-09-05 22:24:35
|
Howdy all, I have an interesting problem ... I have used some of the sample code in tutorial1 to make my own sample application. Using PersistenceBroker, I'm trying to create records in a table that has only 2 fields (the PK and a text field) ... It seems like it's working because i'm getting new uniqueIDs from the broker.getUniqueId() call, but when I look in the DB, nothing has been created in my table, nor have any records been created in the obj_seq table ... here's a trimmed down version of what I'm doing ... I'm using Postgres 7.1.2 (and the corresponding JDBC driver) and i'm using the latest OJB (0.5.155) .. SQL Schema create table color( color_id int not null primary key, name varchar(100) not null ); in REPOSITORY.XML <ClassDescriptor id="7"> <class.name>schema.Color</class.name> <table.name>color</table.name> <FieldDescriptor id="1"> <field.name>colorID</field.name> <column.name>color_id</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> </FieldDescriptor> <FieldDescriptor id="2"> <field.name>name</field.name> <column.name>name</column.name> <jdbc_type>VARCHAR</jdbc_type> </FieldDescriptor> </ClassDescriptor> JAVA application: public myMethod() { public static final String[] colorList = {"Red","Yellow","Green","Purple","Black"}; broker = PersistenceBrokerFactory.createPersistenceBroker("repository.xml"); broker.beginTransaction(); for(int i=0; i<colorList.length; i++) { Color color = new Color(); color.setName(colorList[i]); color.setColorID(new Integer(broker.getUniqueId(Color.class,"colorID"))); broker.store(color); log("Created new Color with ID: " + color.getColorID()); } broker.commitTransaction(); } the OUTPUT from myMethod: Created new Color with ID: 1 Created new Color with ID: 2 Created new Color with ID: 3 Created new Color with ID: 4 Created new Color with ID: 5 Has anyone heard of such a thing? It's as if the transaction isn't committed to the DB ... If i start another instance of this application while one is running, it hangs until the first one is killed, so that usually means that there is an uncommitted transaction hanging around ... -Dave |
From: Ivan T. <to...@cr...> - 2001-09-03 08:48:28
|
On Mon, 2001-09-03 at 10:45, Mahler Thomas wrote: > Hi Ivan, >=20 > I had a look at your dtd over the weekend I made some minor > corrections/additions. See attached dtd. I also modified the repository.x= ml > accordingly but could not finish it due to lack of time. but you will get= an > impression... >=20 > > -----Urspr=FCngliche Nachricht----- > > Von: Ivan Toshkov [mailto:to...@cr...] > > Gesendet: Freitag, 31. August 2001 16:37 > > An: Mahler Thomas > > Cc: objectbridge > > Betreff: Re: AW: [Objectbridge-developers] [Fwd: [objectbridge - Open > > Discussi on] New repository.xml/dtd proposal.] > >=20 > >=20 > > Hi all, > >=20 > > Hopefully, I've changed everything as we discussed, added the missing > > `size' and `nullable' attributes and made the xml a little bit more > > readable. > >=20 > > Please review it, to see if there is something wrong or missing. > > Especially with the `ref-id' elements, cause I'm not sure=20 > > I've done them > > right. > >=20 > > Is it correct that `ReferenceDescriptor/descriptor_ids'=20 > > points to fields > > in the current class, and for `CollectionDescriptor/descriptor_ids' -- > > to fields in the referenced class? > > >=20 > yes that's right. I tried to make this even clearer by calling the ref-id= s > "foreignkey". The foreignkey attribute is always in the table on the N-si= de > of the 1-N relationship. >=20 > >=20 > > Also, I see that the method > > ObjectReferenceDescriptor.getForeignKeyFields() returns a=20 > > list of ids. I > > can preserve it's semantics, but I wonder if this is realy needed. > >=20 >=20 > It's possible to have compound primary keys. Thus it's also possible to h= ave > compound foreign keys. Perhaps, I hadn't formulated my question right. Returning a list is ok, but why should it contains IDs? Why not list of FieldDescriptors? =20 >=20 > See my changes to your DTD and my comments below >=20 > <?xml version=3D"1.0" encoding=3D"UTF-8" ?> >=20 > <!ELEMENT mapping-repository ( jdbc-connection+, table+, class+, > class-extent* ) > >=20 > <!ELEMENT jdbc-connection EMPTY > > <!ATTLIST jdbc-connection id ID #REQUIRED > name CDATA #REQUIRED > driver CDATA #REQUIRED > protocol CDATA #REQUIRED > subprotocol CDATA #REQUIRED > dbalias CDATA #REQUIRED > username CDATA #IMPLIED > password CDATA #IMPLIED > >=20 > <!ELEMENT table ( column+ ) > > <!ATTLIST table id ID #REQUIRED > schema CDATA #IMPLIED <!-- we had a schema sttribute wi= th > the jdbc-connection,=20 > but it has to be assigned to > the table.--> > name CDATA #REQUIRED > jdbc-ref IDREF #REQUIRED > >=20 > <!ELEMENT column EMPTY > > <!ATTLIST column id ID #REQUIRED <!-- columns need an ID to be > referenced from field decriptors --> > name CDATA #REQUIRED > type ( BIT | TINYINT | SMALLINT | INTEGER | BIGINT | DOU= BLE > | FLOAT | REAL | NUMERIC | DECIMAL | CHAR | VARCH= AR > | LONGVARCHAR | DATE | TIME | TIMESTAMP | BINARY > | VARBINARY | LONGVARBINARY) #REQUIRED > primary-key ( yes | no ) "no" > nullable ( yes | no ) "yes" > indexed ( yes | no ) "no" > size CDATA #IMPLIED > >=20 > <!ELEMENT class ( extent*, field+, reference*, collection* ) > <!-- a > persistence class must=20 > have = at > least one field descriptor --> > <!ATTLIST class name ID #REQUIRED > table-ref IDREF #REQUIRED > orderby-field-ref IDREF #IMPLIED <!-- you ommited the > orderby atribute. it's a reference=20 > to a field > descriptor --> > conversion-strategy CDATA #IMPLIED > proxy CDATA #IMPLIED > >=20 > <!ELEMENT extent EMPTY > > <!ATTLIST extent class-ref IDREF #REQUIRED > <!-- we only allow classes i= n > an extend definition that are=20 > explained somewhere els= e > in the repository --> >=20 > <!ELEMENT field EMPTY > > <!ATTLIST field id ID #REQUIRED <!-- we need references > to fields in foreignkey-elements --> > name CDATA #REQUIRED > column-ref IDREF #REQUIRED <!-- reference to > column element --> > conversion-strategy CDATA #IMPLIED > <!-- I'd like to hav= e a > conversion strategy possible=20 > for attributes = too > --> >=20 > <!ELEMENT reference (foreignkey+) > <!-- renamed the ref-id element --> I would preffer to call it foreign-key if that's ok? :) > <!ATTLIST reference name CDATA #REQUIRED > class-ref IDREF #REQUIRED <!-- reference t= o a > class element --> > auto-retrieve ( yes | no ) "yes" > auto-update ( yes | no ) "no" > auto-delete ( yes | no ) "no" > >=20 > <!-- thma: renamed ref-id -> > <!ELEMENT foreignkey EMPTY > > <!ATTLIST foreignkey field-ref IDREF #REQUIRED > <!-- reference to a fiel= d > descriptor that contains a foreign key--> >=20 > <!ELEMENT collection ( foreignkey+ ) > <!-- renamed the ref-id element -= -> > <!ATTLIST collection name CDATA #REQUIRED > item-class-ref IDREF #REQUIRED <!-- this hold= s a > reference to the item class description --> =20 > collection-class CDATA #IMPLIED > auto-retrieve ( yes | no ) "yes" > auto-update ( yes | no ) "no" > auto-delete ( yes | no ) "no" > >=20 > <!ELEMENT class-extent ( extent+ ) > > <!ATTLIST class-extent name CDATA #REQUIRED > >=20 >=20 > I have a question: What is the scope of an XML ID? The whole xml document= or > only the enclosing element? The scope is the full document. > As far as I know they have document scope. thus I had to use fully qualif= ied > names in the ID fields (for example for fields and columns), which make t= he > repository quite verbose and redundant. >=20 > Do you see any solution to this? There are perhaps two solutions: 1) Use XML Schema rather than DTD. I think it supports that kind of refernces. 2) Check the consistency in the code. That is, no ID attribute for fields, only name. The foriegn-key element will always be a child of reference element, which has a class-ref attribute. I'd vote for the second solution, because it is simpler, cleaner and later can be extended with the first. >=20 > Thomas >=20 >=20 >=20 > > -- > > Ivan > >=20 >=20 |
From: Mahler T. <tho...@it...> - 2001-09-03 07:45:44
|
Hi Ivan, I had a look at your dtd over the weekend I made some minor corrections/additions. See attached dtd. I also modified the = repository.xml accordingly but could not finish it due to lack of time. but you will = get an impression... > -----Urspr=FCngliche Nachricht----- > Von: Ivan Toshkov [mailto:to...@cr...] > Gesendet: Freitag, 31. August 2001 16:37 > An: Mahler Thomas > Cc: objectbridge > Betreff: Re: AW: [Objectbridge-developers] [Fwd: [objectbridge - Open > Discussi on] New repository.xml/dtd proposal.] >=20 >=20 > Hi all, >=20 > Hopefully, I've changed everything as we discussed, added the missing > `size' and `nullable' attributes and made the xml a little bit more > readable. >=20 > Please review it, to see if there is something wrong or missing. > Especially with the `ref-id' elements, cause I'm not sure=20 > I've done them > right. >=20 > Is it correct that `ReferenceDescriptor/descriptor_ids'=20 > points to fields > in the current class, and for `CollectionDescriptor/descriptor_ids' = -- > to fields in the referenced class? > yes that's right. I tried to make this even clearer by calling the = ref-ids "foreignkey". The foreignkey attribute is always in the table on the = N-side of the 1-N relationship. >=20 > Also, I see that the method > ObjectReferenceDescriptor.getForeignKeyFields() returns a=20 > list of ids. I > can preserve it's semantics, but I wonder if this is realy needed. >=20 It's possible to have compound primary keys. Thus it's also possible to = have compound foreign keys.=20 See my changes to your DTD and my comments below <?xml version=3D"1.0" encoding=3D"UTF-8" ?> <!ELEMENT mapping-repository ( jdbc-connection+, table+, class+, class-extent* ) > <!ELEMENT jdbc-connection EMPTY > <!ATTLIST jdbc-connection id ID #REQUIRED name CDATA #REQUIRED driver CDATA #REQUIRED protocol CDATA #REQUIRED subprotocol CDATA #REQUIRED dbalias CDATA #REQUIRED username CDATA #IMPLIED password CDATA #IMPLIED > <!ELEMENT table ( column+ ) > <!ATTLIST table id ID #REQUIRED schema CDATA #IMPLIED <!-- we had a schema sttribute = with the jdbc-connection,=20 but it has to be assigned = to the table.--> name CDATA #REQUIRED jdbc-ref IDREF #REQUIRED > <!ELEMENT column EMPTY > <!ATTLIST column id ID #REQUIRED <!-- columns need an ID to be referenced from field decriptors --> name CDATA #REQUIRED type ( BIT | TINYINT | SMALLINT | INTEGER | BIGINT | = DOUBLE | FLOAT | REAL | NUMERIC | DECIMAL | CHAR | = VARCHAR | LONGVARCHAR | DATE | TIME | TIMESTAMP | = BINARY | VARBINARY | LONGVARBINARY) #REQUIRED primary-key ( yes | no ) "no" nullable ( yes | no ) "yes" indexed ( yes | no ) "no" size CDATA #IMPLIED > <!ELEMENT class ( extent*, field+, reference*, collection* ) > <!-- a persistence class must=20 = have at least one field descriptor --> <!ATTLIST class name ID #REQUIRED table-ref IDREF #REQUIRED orderby-field-ref IDREF #IMPLIED <!-- you ommited the orderby atribute. it's a reference=20 to a field descriptor --> conversion-strategy CDATA #IMPLIED proxy CDATA #IMPLIED > <!ELEMENT extent EMPTY > <!ATTLIST extent class-ref IDREF #REQUIRED > <!-- we only allow classes = in an extend definition that are=20 explained somewhere = else in the repository --> <!ELEMENT field EMPTY > <!ATTLIST field id ID #REQUIRED <!-- we need references to fields in foreignkey-elements --> name CDATA #REQUIRED column-ref IDREF #REQUIRED <!-- reference to column element --> conversion-strategy CDATA #IMPLIED > <!-- I'd like to = have a conversion strategy possible=20 for = attributes too --> <!ELEMENT reference (foreignkey+) > <!-- renamed the ref-id element --> <!ATTLIST reference name CDATA #REQUIRED class-ref IDREF #REQUIRED <!-- reference = to a class element --> auto-retrieve ( yes | no ) "yes" auto-update ( yes | no ) "no" auto-delete ( yes | no ) "no" > <!-- thma: renamed ref-id -> <!ELEMENT foreignkey EMPTY > <!ATTLIST foreignkey field-ref IDREF #REQUIRED > <!-- reference to a = field descriptor that contains a foreign key--> <!ELEMENT collection ( foreignkey+ ) > <!-- renamed the ref-id element = --> <!ATTLIST collection name CDATA #REQUIRED item-class-ref IDREF #REQUIRED <!-- this = holds a reference to the item class description --> =20 collection-class CDATA #IMPLIED auto-retrieve ( yes | no ) "yes" auto-update ( yes | no ) "no" auto-delete ( yes | no ) "no" > <!ELEMENT class-extent ( extent+ ) > <!ATTLIST class-extent name CDATA #REQUIRED > I have a question: What is the scope of an XML ID? The whole xml = document or only the enclosing element? As far as I know they have document scope. thus I had to use fully = qualified names in the ID fields (for example for fields and columns), which make = the repository quite verbose and redundant. Do you see any solution to this? Thomas > -- > Ivan >=20 |