objectbridge-developers Mailing List for ObJectRelationalBridge (Page 13)
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: Matthew B. <ma...@so...> - 2002-05-26 17:45:22
|
What about something like: rowCount() elementCount() actualRowCount() actualElementCount() that got me thinking: unboundedCount(); unboundedElementCount() Hmm.. maybe I'll just pick one. |
From: Thomas M. <tho...@ho...> - 2002-05-26 08:46:57
|
Hi Travis, Say you have a persistent object instance. To perform a refreh of this object use PersistenceBroker broker = PersistenceBroker.createPersistenceBroker(); Identity oid = new Identity(instance); broker.invalidate(oid); instance = broker.getObjectByIdentity(oid) HTH, Thomas tr...@th... wrote: > Is there any method in place for doing this? Just wondering for jdo, below is what should happen. > > /** Refresh the state of the instance from the data store. > * > * <P>In an optimistic transaction, the state of instances in the cache > * might not match the state in the data store. This method is used to > * reload the state of the instance from the data store so that a subsequent > * commit is more likely to succeed. > * <P>Outside a transaction, this method will refresh nontransactional state. > * @param pc the instance to refresh. > */ > > > Travis > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |
From: Thomas M. <tho...@ho...> - 2002-05-26 08:40:38
|
Hi Jakob, Jakob Braeuchi wrote: > hi thomas, > > unfortunately it's not related to buggy extent definition, it's a general > problem !!! > :-( > when the SqlStatement resolves the path expressions ie: > 'allArticlesInGroup.id' then it looks up the collection descriptor for > 'allArticlesInGroup' in the class definition of productgroup. > this collection descriptor references the base class only ( Article ), so > SqlStatement will use the table of the base class for the query and thus > will not find a productgroup for the CdArticle with id 200. > Oh, now I got it! That's really a problem. > i implemented a kind of hint for SqlStatement: > QueryByCriteria#addPathClass(aPathSegment, aClass) > > ie: addPathClass("allArticlesInGroup", CdArticle.class), so SqlStatement > will use the table for CdArticle when building the sql. > OK! > this stuff is now in cvs, and there's also a testcase for it: > QueryTest#testInversePathExpression(). > so far it's used only for querying inverse m:n relationships in > PersistenceBrokerImpl##getMtoNQuery(). > > an other cleaner solution would be the use of sql UNION whenever dealing > with extents, but mysql currently does not support them. > Yes UNION statements are not supported on some platforms and on other platforms they are quite slow. So I think using a hin for this kind of lookups is OK. cheers, Thomas |
From: Thomas M. <tho...@ho...> - 2002-05-26 08:40:27
|
Hi Matthew, Matthew Baird wrote: > I'm currently working on some rudimentary cursor control for ODMG. good idea! >I want to > outline my approach and solicite some feedback: > > 1. Creation of an EnhancedOQLQuery interface that includes: > void create(String queryString, int startAtIndex, int > endAtIndex) throws QueryInvalidException; > int fullSize(); > ACK > 2. have OQLQueryImpl implement both OQLQuery and EnhancedOQLQuery. > ACK > 3. create(String, int, int) creates a query that uses the resultsets > underlying cursor to return results starting at startAtIndex, and ending at > endAtIndex, thus being the most efficient way to return results for a "page" > of data. ACK How does it work internally? Are you using PersistenceBroker.getIteratorByQuery(...)? How do you manage to start at a given index? > > 4. fullSize() returns the actual size the query returns, based on using the > underlying resultsets cursor to move rows instead of iterating through. If > you have a start and end index, it will still return how many rows the query > would have returned if you hadn't limited it. ACK > > GOALS: > - Backward compatibility. If you don't want this functionality, don't change > your code and it will continue to work exactly as before. > - Maximum efficiency for building a paged result set of many items. In our > application we have to display the classic (1-10 of 100,002,040) paged > result set. If we had to iterate through the results materializing objects > (even proxies) it could take all day to display one page. Using the query to > limit the number of returned objects or just displaying 1-10 of LOTS! Is not > an option as the last number is important for the user. > - improve performance of OJB by only using scrollable resultsets if the user > needs them. > > I currently DO NOT like the names I made for getting the size on the > underlying query. Please comment on what they should be. What about something like: rowCount() elementCount() actualRowCount() actualElementCount() > > I have a full test suite for the implementation that stresses every > combination of startAtIndex/endAtIndex and size. > that's a real plus! I think a paging query is a very useful thing not only for the ODMG implementation but also for the PersistenceBroker. cheers, Thomas > Please send me your thoughts. Thanks > Matthew > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |
From: Matthew E. P. <ma...@li...> - 2002-05-26 05:03:20
|
That's is probably the easiest thing to do. I am going to checkin the cvswrappers file that will enforce binary mode for .jar files. -matthew porter On Saturday, May 25, 2002, at 11:47 PM, Matthew Baird wrote: > Maybe I should just nuke those old files and check them in as binaries > under > different names.... > > -----Original Message----- > From: David Forslund [mailto:dw...@la...] > Sent: Saturday, May 25, 2002 9:15 PM > To: Matthew E. Porter; obj...@li... > Subject: Re: [OJB-developers] Fresh Checkout - JDO Problem? > > The files are still in text. cvswrappers is a good way to enforce jar > files to be binary. It is tricky > to change an existing file from jar to binary. Perhaps the easiest > is to > get the files > from the Sun JDO distribution. > > Dave > At 11:06 PM 5/25/2002 -0500, Matthew E. Porter wrote: >> I just performed a fresh checkout from cvs and it appears that the >> jdo.jar >> is still not correct. I am receiving complaints about missing classes, >> such as javax.jdo.PersistenceManager. If this problem originates from >> jar >> files being checked in as text files, is anyone opposed to setting the >> cvswrappers to force all jar files in binary mode. This is probably >> the >> simplest way to enforce this. Or am I doing something wrong that is >> causing the system not to build? >> >> >> -matthew porter >> >> >> _______________________________________________________________ >> >> Don't miss the 2002 Sprint PCS Application Developer's Conference >> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm >> >> _______________________________________________ >> Objectbridge-developers mailing list >> Obj...@li... >> https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Matthew B. <ma...@so...> - 2002-05-26 04:46:59
|
Maybe I should just nuke those old files and check them in as binaries under different names.... -----Original Message----- From: David Forslund [mailto:dw...@la...] Sent: Saturday, May 25, 2002 9:15 PM To: Matthew E. Porter; obj...@li... Subject: Re: [OJB-developers] Fresh Checkout - JDO Problem? The files are still in text. cvswrappers is a good way to enforce jar files to be binary. It is tricky to change an existing file from jar to binary. Perhaps the easiest is to get the files from the Sun JDO distribution. Dave At 11:06 PM 5/25/2002 -0500, Matthew E. Porter wrote: >I just performed a fresh checkout from cvs and it appears that the jdo.jar >is still not correct. I am receiving complaints about missing classes, >such as javax.jdo.PersistenceManager. If this problem originates from jar >files being checked in as text files, is anyone opposed to setting the >cvswrappers to force all jar files in binary mode. This is probably the >simplest way to enforce this. Or am I doing something wrong that is >causing the system not to build? > > >-matthew porter > > >_______________________________________________________________ > >Don't miss the 2002 Sprint PCS Application Developer's Conference >August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > >_______________________________________________ >Objectbridge-developers mailing list >Obj...@li... >https://lists.sourceforge.net/lists/listinfo/objectbridge-developers _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: David F. <dw...@la...> - 2002-05-26 04:15:00
|
The files are still in text. cvswrappers is a good way to enforce jar files to be binary. It is tricky to change an existing file from jar to binary. Perhaps the easiest is to get the files from the Sun JDO distribution. Dave At 11:06 PM 5/25/2002 -0500, Matthew E. Porter wrote: >I just performed a fresh checkout from cvs and it appears that the jdo.jar >is still not correct. I am receiving complaints about missing classes, >such as javax.jdo.PersistenceManager. If this problem originates from jar >files being checked in as text files, is anyone opposed to setting the >cvswrappers to force all jar files in binary mode. This is probably the >simplest way to enforce this. Or am I doing something wrong that is >causing the system not to build? > > >-matthew porter > > >_______________________________________________________________ > >Don't miss the 2002 Sprint PCS Application Developer's Conference >August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > >_______________________________________________ >Objectbridge-developers mailing list >Obj...@li... >https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Matthew E. P. <ma...@li...> - 2002-05-26 04:06:47
|
I just performed a fresh checkout from cvs and it appears that the jdo.jar is still not correct. I am receiving complaints about missing classes, such as javax.jdo.PersistenceManager. If this problem originates from jar files being checked in as text files, is anyone opposed to setting the cvswrappers to force all jar files in binary mode. This is probably the simplest way to enforce this. Or am I doing something wrong that is causing the system not to build? -matthew porter |
From: <tr...@th...> - 2002-05-26 00:31:31
|
Is there any method in place for doing this? Just wondering for jdo, below is what should happen. /** Refresh the state of the instance from the data store. * * <P>In an optimistic transaction, the state of instances in the cache * might not match the state in the data store. This method is used to * reload the state of the instance from the data store so that a subsequent * commit is more likely to succeed. * <P>Outside a transaction, this method will refresh nontransactional state. * @param pc the instance to refresh. */ Travis |
From: Matthew B. <ma...@so...> - 2002-05-25 19:02:24
|
I'm currently working on some rudimentary cursor control for ODMG. I want to outline my approach and solicite some feedback: 1. Creation of an EnhancedOQLQuery interface that includes: void create(String queryString, int startAtIndex, int endAtIndex) throws QueryInvalidException; int fullSize(); 2. have OQLQueryImpl implement both OQLQuery and EnhancedOQLQuery. 3. create(String, int, int) creates a query that uses the resultsets underlying cursor to return results starting at startAtIndex, and ending at endAtIndex, thus being the most efficient way to return results for a "page" of data. 4. fullSize() returns the actual size the query returns, based on using the underlying resultsets cursor to move rows instead of iterating through. If you have a start and end index, it will still return how many rows the query would have returned if you hadn't limited it. GOALS: - Backward compatibility. If you don't want this functionality, don't change your code and it will continue to work exactly as before. - Maximum efficiency for building a paged result set of many items. In our application we have to display the classic (1-10 of 100,002,040) paged result set. If we had to iterate through the results materializing objects (even proxies) it could take all day to display one page. Using the query to limit the number of returned objects or just displaying 1-10 of LOTS! Is not an option as the last number is important for the user. - improve performance of OJB by only using scrollable resultsets if the user needs them. I currently DO NOT like the names I made for getting the size on the underlying query. Please comment on what they should be. I have a full test suite for the implementation that stresses every combination of startAtIndex/endAtIndex and size. Please send me your thoughts. Thanks Matthew |
From: David W F. <dw...@la...> - 2002-05-25 19:00:18
|
Yes, I reported this several days ago. It looks like it was fixed now, though. Dave Matthew Baird writes: > I've experienced problems with the jdo jars on 2 machines now (both > windows). Is there a chance those files are corrupt? > > Anyone experiencing this? > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: <tr...@th...> - 2002-05-25 18:55:06
|
I think I found this problem and it should be fixed on latest checkout as I hadn't removed the old jdo sources that were in the ojb tree. These are now removed so a new checkout (and make sure it's fresh or delete the src/java/javax directory) should fix the problem. Travis ---- Original Message ---- From: Matthew Baird <ma...@so...> Sent: 2002-05-25 To: obj...@li... Subject: [OJB-developers] JDO libs problem? I've experienced problems with the jdo jars on 2 machines now (both windows). Is there a chance those files are corrupt? Anyone experiencing this? _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Matthew B. <ma...@so...> - 2002-05-25 18:40:31
|
OK I updated with latest through Eclipse. Should be in binary mode. -----Original Message----- From: Florian Bruckner [mailto:bf...@fl...] Sent: Saturday, May 25, 2002 11:01 AM To: Matthew Baird Cc: obj...@so... Subject: RE: [OJB-developers] JDO libs problem? Hi, > I've experienced problems with the jdo jars on 2 machines now (both > windows). Is there a chance those files are corrupt? > > Anyone experiencing this? Yep, they are text mode, not binary. PLEASE: If you add a binary file to CVS, add the parameter -kb to your add command, so we lame windows users can use a cvs checkout without problems. btw, I just sent our licensing question to the jakarta-general list, maybe we'll get some help from them. best regards, Florian _______________________________________________________________ Don't miss the 2002 Sprint PCS Application Developer's Conference August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm _______________________________________________ Objectbridge-developers mailing list Obj...@li... https://lists.sourceforge.net/lists/listinfo/objectbridge-developers |
From: Florian B. <bf...@fl...> - 2002-05-25 18:00:40
|
Hi, > I've experienced problems with the jdo jars on 2 machines now (both > windows). Is there a chance those files are corrupt? > > Anyone experiencing this? Yep, they are text mode, not binary. PLEASE: If you add a binary file to CVS, add the parameter -kb to your add command, so we lame windows users can use a cvs checkout without problems. btw, I just sent our licensing question to the jakarta-general list, maybe we'll get some help from them. best regards, Florian |
From: Matthew B. <ma...@so...> - 2002-05-25 17:44:43
|
I've experienced problems with the jdo jars on 2 machines now (both windows). Is there a chance those files are corrupt? Anyone experiencing this? |
From: Jakob B. <jbr...@ho...> - 2002-05-25 12:35:57
|
hi thomas, > > 1) is it acceptable to have an extent definition that does not match the > > class hierarchy ? > I once build it this way out of fancy. I found it a cool feature. But I > don't think that it is useful at all. It also may confuse people. So the > best thing will be to drop it. there's not much to drop, i will only fix the inheritence of CdArticle and it will (should) work. > > 2) shouldn't the above check be made based on the interface ? > ACK! i'll have a look at it. greetings from rainy and cold switzerland jakob ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Jakob Braeuchi" <jbr...@ho...> Cc: <obj...@li...> Sent: Friday, May 24, 2002 8:08 PM Subject: Re: [OJB-developers] extents and class hierarchy > Hi Jakob, > > Jakob Braeuchi wrote: > > > hi , > > > > while working on a test case for ProductGroup i found that the ProductGroup > > only contains articles of classes Article and BokArticle although an query > > is successfully executed for CdArticle . > > in the repository CdArticle is defined as an extent of Article but it does > > not inherit from it, but CdArticle implements InterfaceArticele. > > > > PersistenceBrokerImpl#getCollectionByQuery() does not accept CdArticle for > > Article: > > > > // only add candidates with matching class > > if (itemClass.isAssignableFrom(candidateClass)) > > { > > tmpMap.add(candidate); > > } > > > > i now have two questions: > > 1) is it acceptable to have an extent definition that does not match the > > class hierarchy ? > > > I once build it this way out of fancy. I found it a cool feature. But I > don't think that it is useful at all. It also may confuse people. So the > best thing will be to drop it. > > > > 2) shouldn't the above check be made based on the interface ? > > > ACK! > > cu, > > Thomas > > > > > > jakob > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Objectbridge-developers mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > > > > > > |
From: Jakob B. <jbr...@ho...> - 2002-05-25 12:20:26
|
hi thomas, unfortunately it's not related to buggy extent definition, it's a general problem !!! when the SqlStatement resolves the path expressions ie: 'allArticlesInGroup.id' then it looks up the collection descriptor for 'allArticlesInGroup' in the class definition of productgroup. this collection descriptor references the base class only ( Article ), so SqlStatement will use the table of the base class for the query and thus will not find a productgroup for the CdArticle with id 200. i implemented a kind of hint for SqlStatement: QueryByCriteria#addPathClass(aPathSegment, aClass) ie: addPathClass("allArticlesInGroup", CdArticle.class), so SqlStatement will use the table for CdArticle when building the sql. this stuff is now in cvs, and there's also a testcase for it: QueryTest#testInversePathExpression(). so far it's used only for querying inverse m:n relationships in PersistenceBrokerImpl##getMtoNQuery(). an other cleaner solution would be the use of sql UNION whenever dealing with extents, but mysql currently does not support them. jakob ----- Original Message ----- From: "Thomas Mahler" <tho...@ho...> To: "Jakob Braeuchi" <jbr...@ho...> Cc: <obj...@li...> Sent: Friday, May 24, 2002 8:19 PM Subject: Re: [OJB-developers] problem with path expressions and extents > Hi Jakob, > > I'm not quite sure, but I think this is related to the "buggy" extent > definition for class Article. > > If the InterfaceArticle was used as extent class all would be OK, > without any changes to Query. > > We should setup a new testcase with new persistent classes. The old > Article ProductGroup stuff is messed up a bit. > > > HTH, > > Thomas > > Jakob Braeuchi wrote: > > > hi all, > > > > we have a general problem when using path expression and extents. > > the following test case reads a cd (an extent of article) and then tries to > > read the product group using the relationship 'allArticlesInGroup' belonging > > to this cd in a second query. the second query cannot find the productgroup > > because 'allArticlesInGroup' refers to Article and not to Cd, so the > > article-table is used in the join: > > > > SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Kategorien A0 > > INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr > > = ? > > > > the query returning the correct result: > > > > SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Cds A0 INNER > > JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr = ? > > > > i think we need some kind of hints for path expression, so SqlStatement > > knows which tables to use. > > the hints can be set on Criteria or Query level: > > > > query.useClass("AllProductsInGroup", Cd.class) > > > > > > Query query; > > Criteria crit; > > CdArticle cd; > > ProductGroup pg; > > > > System.out.println("\nread a single cd"); > > crit = new Criteria(); > > crit.addEqualTo("articleId", new Integer(200)); > > query = new QueryByCriteria(CdArticle.class, crit); > > cd = (CdArticle) broker.getObjectByQuery(query); > > System.out.println(cd); > > > > System.out.println("\nread product group for cd"); > > crit = new Criteria(); > > crit.addEqualTo("allArticlesInGroup.articleId",new > > Integer(cd.getArticleId())); > > query = new QueryByCriteria(ProductGroup.class, crit); > > pg = (ProductGroup) broker.getObjectByQuery(query); > > System.out.println(pg); > > > > this kind of query may look a little exotic in the above sample, but it's > > the kind of query used in non decomposed m:n relationship. so we definitely > > need a solution here. > > > > any help will be appreciated. > > > > > > > > > jakob > > > > _______________________________________________________________ > > > > Don't miss the 2002 Sprint PCS Application Developer's Conference > > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > > > _______________________________________________ > > Objectbridge-developers mailing list > > Obj...@li... > > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > > > > > > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > |
From: Thomas M. <tho...@ho...> - 2002-05-24 18:41:35
|
Hi Brian, Brian Devries wrote: > Hi all, > > First, I will say that I have just begun working with OJB and have been > very pleased with it (especially after first testing/using Castor). thanks <snip problem & fix> > Does this approach/fix seem correct? It definitely seems to me that the > inverse foreign key fields in a related object should be updated before > locking that object, in case in situations like this, that those fields > are also primary keys of the related object. > Yes, I agree, this looks like an OJB bug! I think you patch really solve this issue, I will add this to our codebase. Thanks, Thomas > Any feedback would be great. > > -BD > > -- > Brian DeVries Sr. Software Engineer > mailto:bde...@in... http://www.intraware.com > Voice: 925.253.6516 Fax: 925.253.6785 > -------------------------------------------------------- > Intraware... The leading provider of Electronic Software > Delivery and Management (ESDM) Solutions > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |
From: Thomas M. <tho...@ho...> - 2002-05-24 18:18:58
|
Hi Jakob, I'm not quite sure, but I think this is related to the "buggy" extent definition for class Article. If the InterfaceArticle was used as extent class all would be OK, without any changes to Query. We should setup a new testcase with new persistent classes. The old Article ProductGroup stuff is messed up a bit. HTH, Thomas Jakob Braeuchi wrote: > hi all, > > we have a general problem when using path expression and extents. > the following test case reads a cd (an extent of article) and then tries to > read the product group using the relationship 'allArticlesInGroup' belonging > to this cd in a second query. the second query cannot find the productgroup > because 'allArticlesInGroup' refers to Article and not to Cd, so the > article-table is used in the join: > > SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Kategorien A0 > INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr > = ? > > the query returning the correct result: > > SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Cds A0 INNER > JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr = ? > > i think we need some kind of hints for path expression, so SqlStatement > knows which tables to use. > the hints can be set on Criteria or Query level: > > query.useClass("AllProductsInGroup", Cd.class) > > > Query query; > Criteria crit; > CdArticle cd; > ProductGroup pg; > > System.out.println("\nread a single cd"); > crit = new Criteria(); > crit.addEqualTo("articleId", new Integer(200)); > query = new QueryByCriteria(CdArticle.class, crit); > cd = (CdArticle) broker.getObjectByQuery(query); > System.out.println(cd); > > System.out.println("\nread product group for cd"); > crit = new Criteria(); > crit.addEqualTo("allArticlesInGroup.articleId",new > Integer(cd.getArticleId())); > query = new QueryByCriteria(ProductGroup.class, crit); > pg = (ProductGroup) broker.getObjectByQuery(query); > System.out.println(pg); > > this kind of query may look a little exotic in the above sample, but it's > the kind of query used in non decomposed m:n relationship. so we definitely > need a solution here. > > any help will be appreciated. > > jakob > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |
From: Thomas M. <tho...@ho...> - 2002-05-24 18:08:20
|
Hi Jakob, Jakob Braeuchi wrote: > hi , > > while working on a test case for ProductGroup i found that the ProductGroup > only contains articles of classes Article and BokArticle although an query > is successfully executed for CdArticle . > in the repository CdArticle is defined as an extent of Article but it does > not inherit from it, but CdArticle implements InterfaceArticele. > > PersistenceBrokerImpl#getCollectionByQuery() does not accept CdArticle for > Article: > > // only add candidates with matching class > if (itemClass.isAssignableFrom(candidateClass)) > { > tmpMap.add(candidate); > } > > i now have two questions: > 1) is it acceptable to have an extent definition that does not match the > class hierarchy ? I once build it this way out of fancy. I found it a cool feature. But I don't think that it is useful at all. It also may confuse people. So the best thing will be to drop it. > 2) shouldn't the above check be made based on the interface ? ACK! cu, Thomas > > jakob > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > > |
From: Thomas M. <tho...@ho...> - 2002-05-24 18:03:08
|
Hi Martin, Martin Poeschl wrote: > Mahler Thomas wrote: > <snip> > >> 2. How to generat HTML documents from the XDOCS documents. <snip> >> > using maven would be the best way .. i could also add some stuff to the > build.xml to generate the docs Yes, that would be great, as many people may want to generate documentation without needing maven as a prerequisit. > if you like the maven generated docs we can switch to use it for the site > > look at http://www.apache.org/~mpoeschl/ojb > > we could replace the jakarta logo until ojb becomes an apache project > Yes, I like this style! I think for generating a full release of the website MAVEN is great. but for someone who just wants do generate the ordinary html and javadocs it may be a burden. thanks, Thomas > martin > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > https://lists.sourceforge.net/lists/listinfo/objectbridge-developers > > > |
From: Jakob B. <jbr...@ho...> - 2002-05-23 20:25:54
|
hi , while working on a test case for ProductGroup i found that the ProductGroup only contains articles of classes Article and BokArticle although an query is successfully executed for CdArticle . in the repository CdArticle is defined as an extent of Article but it does not inherit from it, but CdArticle implements InterfaceArticele. PersistenceBrokerImpl#getCollectionByQuery() does not accept CdArticle for Article: // only add candidates with matching class if (itemClass.isAssignableFrom(candidateClass)) { tmpMap.add(candidate); } i now have two questions: 1) is it acceptable to have an extent definition that does not match the class hierarchy ? 2) shouldn't the above check be made based on the interface ? jakob |
From: Brian D. <bde...@in...> - 2002-05-23 18:47:29
|
Hi all, First, I will say that I have just begun working with OJB and have been very pleased with it (especially after first testing/using Castor). Please let me know if the problem I am describing below is because of any misunderstanding about how OJB should work. I am having problems using the ODMG API when trying to create a new object with an auto-incremented primary key, and with new objects related in a collection on that object associated by that primary key. I have object User which has a collection descriptor to Permission objects. The User object has a primary key userID which is auto-incremented. The Permission object is related in the collection by that userID. Note that this is a decomposed m-n relationship, so both userID and permID in the Permission object are primary keys on that object. In code then I try the following: Transaction tx = OJB.getInstance().newTransaction(); tx.begin(); String[] permIDs = String[] { "DNLD" }; Vector perms = new Vector(); for(int i = 0; i < permIDs; i++) { Permission p = new Permission(); p.setPermissionCode(permIDs[i]); perms.add(p); } User user = new User(); user.setPermissions(perms); tx.lock(user, tx.WRITE); tx.commit(); As I would expect, this auto generates a primary key for the new user object, commits that user object to the user table, and correctly commits three entries in the permission table with that newly created userID. The problem is with the locking. It looks like a lock is created on the Permission objects while their userID fields are null, then when they are created, the userID fields are updated with the new userID, and then the lock is released on the Permission object with the userID. The lock on the null valued userID permission objects is never released. Here is a dump from the ODMG debug log: [ODMG] DEBUG: register: com.intraware.vo.User{15}(ojb.odmg.states.StateNewDirty) [ODMG] DEBUG: LM.writeLock(tx-172.16.36.211:14693:edf9f4459a:-8000, com.intraware.vo.Permission{null,DNLD}) [ODMG] DEBUG: register: com.intraware.vo.Permission{null,DNLD}(ojb.odmg.states.StateNewDirty) [ODMG] DEBUG: commit: com.intraware.vo.User{15}(ojb.odmg.states.StateNewDirty) [ODMG] DEBUG: LM.upgradeLock(tx-172.16.36.211:14693:edf9f4459a:-8000, com.intraware.vo.User{15}) [ODMG] DEBUG: commit: com.intraware.vo.Permission{null,DNLD}(ojb.odmg.states.StateNewDirty) [ODMG] DEBUG: LM.upgradeLock(tx-172.16.36.211:14693:edf9f4459a:-8000, com.intraware.vo.Permission{null,DNLD}) [ODMG] DEBUG: transition: com.intraware.vo.User{15} (ojb.odmg.states.StateNewDirty --> ojb.odmg.states.StateOldClean) [ODMG] DEBUG: transition: com.intraware.vo.Permission{15,DNLD} (ojb.odmg.states.StateNewDirty --> ojb.odmg.states.StateOldClean) [ODMG] DEBUG: LM.releaseLock(tx-172.16.36.211:14693:edf9f4459a:-8000, com.intraware.vo.User{15}) [ODMG] DEBUG: LM.releaseLock(tx-172.16.36.211:14693:edf9f4459a:-8000, com.intraware.vo.Permission{15,DNLD}) When run the first time everything completes successfully. However, because the lock on Permission{null,DNLD} is never released, trying to run it a second time will create an exception what you can't get a lock on that Permission object again. I think the solution is to add code to the lockCollections() method in TransactionImpl that will update the inverse foreign key field in Permission with the value from the User object prior to calling lock on the objects in the collection. I've updated the code locally to the following which seems to fix the problem: private void lockCollections(ClassDescriptor cld, Object newTxObject, int lockMode) throws IllegalAccessException, PersistenceBrokerException { Iterator i; i = cld.getCollectionDescriptors().iterator(); while (i.hasNext()) { CollectionDescriptor cds = (CollectionDescriptor) i.next(); Object col = cds.getPersistentField().get(newTxObject); if (col != null) { Iterator colIterator; if (col instanceof ManageableCollection) { colIterator = ((ManageableCollection) col).ojbIterator(); } else if (col instanceof Collection) { colIterator = ((Collection) col).iterator(); } else if (col.getClass().isArray()) { colIterator = new ArrayIterator(col); } else { throw new RuntimeException( col.getClass() + " can not be managed by OJB, use Array, Collection or ManageableCollection instead !"); } /** NEW STUFF HERE **/ ClassDescriptor itemCld = this.getBroker().getClassDescriptor(cds.getItemClass()); Object[] objPkValues = cld.getKeyValues(newTxObject); ojb.broker.metadata.FieldDescriptor[] itemFkFields = cds.getForeignKeyFieldDescriptors(itemCld); /** **/ while (colIterator.hasNext()) { /** MORE NEW STUFF HERE **/ Object item = colIterator.next(); for(int j = 0; j < itemFkFields.length; j++) { ojb.broker.metadata.FieldDescriptor fld = itemFkFields[j]; fld.getPersistentField().set(item, objPkValues[j]); } /** **/ //register(item, lockMode); lock(item, lockMode); } } } } ** NOTE: I have _not_ tested this yet with m-n relationships, as I'm not sure how this will be affected. Does this approach/fix seem correct? It definitely seems to me that the inverse foreign key fields in a related object should be updated before locking that object, in case in situations like this, that those fields are also primary keys of the related object. Any feedback would be great. -BD -- Brian DeVries Sr. Software Engineer mailto:bde...@in... http://www.intraware.com Voice: 925.253.6516 Fax: 925.253.6785 -------------------------------------------------------- Intraware... The leading provider of Electronic Software Delivery and Management (ESDM) Solutions |
From: Jakob B. <jbr...@ho...> - 2002-05-23 17:22:57
|
hi all, we have a general problem when using path expression and extents. the following test case reads a cd (an extent of article) and then tries to read the product group using the relationship 'allArticlesInGroup' belonging to this cd in a second query. the second query cannot find the productgroup because 'allArticlesInGroup' refers to Article and not to Cd, so the article-table is used in the join: SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Kategorien A0 INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr = ? the query returning the correct result: SELECT A0.Kategorie_Nr,A0.KategorieName,A0.Beschreibung FROM Cds A0 INNER JOIN Artikel A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A1.Artikel_Nr = ? i think we need some kind of hints for path expression, so SqlStatement knows which tables to use. the hints can be set on Criteria or Query level: query.useClass("AllProductsInGroup", Cd.class) Query query; Criteria crit; CdArticle cd; ProductGroup pg; System.out.println("\nread a single cd"); crit = new Criteria(); crit.addEqualTo("articleId", new Integer(200)); query = new QueryByCriteria(CdArticle.class, crit); cd = (CdArticle) broker.getObjectByQuery(query); System.out.println(cd); System.out.println("\nread product group for cd"); crit = new Criteria(); crit.addEqualTo("allArticlesInGroup.articleId",new Integer(cd.getArticleId())); query = new QueryByCriteria(ProductGroup.class, crit); pg = (ProductGroup) broker.getObjectByQuery(query); System.out.println(pg); this kind of query may look a little exotic in the above sample, but it's the kind of query used in non decomposed m:n relationship. so we definitely need a solution here. any help will be appreciated. jakob |
From: Martin P. <mpo...@ma...> - 2002-05-23 09:42:49
|
Mahler Thomas wrote: >Hi Martin, > >I've got two questions: >1. I still don't get any CVS change mailings. In a previous mail I asked you >to try my home.ins.de account. Did you change the entry accordingly? > sometimes i get the cvs mailings .. i'll check it again .. >2. How to generat HTML documents from the XDOCS documents. I'm currently >redesigning the repository.dtd and will need to change the documentation. I >think the best thing will be to change only one document, i.e. your new >xdocs. But how do I get and ordinary HTML for the website? > >Do I need Maven for this? > using maven would be the best way .. i could also add some stuff to the build.xml to generate the docs if you like the maven generated docs we can switch to use it for the site look at http://www.apache.org/~mpoeschl/ojb we could replace the jakarta logo until ojb becomes an apache project martin |