Re: OQL Limit Queries
Jakob Braeuchi wrote: hi sukesh, afaik the limits cannot be defined in the oql-query. but you can do the following: OQLQuery query = odmg.newOQLQuery(); query.create( "select ." ); query.bind( ... ); ((Query)query).setStartAtIndex(); hth jakob Sukesh Garg wrote: Is there support for "limit" in the OJB's ODMG implementation. e.g. select * from tableName order by id limit 5 thx, sukesh - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hi all, Not with oql query but if you do same thing with: EnhancedOQLQuery query = m_odmg.newOQLQuery(); query.create("select id from " + Address.class.getName(), 1, 3 ); org.apache.ojb.odmg.oql.EnhancedOQLQuery has a create method with offset and limit Hope it's help - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Jeffrey Orford/NY/DOMESTIC/BNY is out of the office.
I will be out of the office starting 10/06/2003 and will not return until 10/14/2003. Please refer any production issues regarding mygtm to Simon Shapiro. The information in this e-mail, and any attachment therein, is confidential and for use by the addressee only. If you are not the intended recipient, please return the e-mail to the sender and delete it from your computer. Although The Bank of New York attempts to sweep e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Criteria.addOrCriteria() not commutative? (inner vs outer join)
hi olli, the problem is identified in method buildJoinTree of SqlQueryStatement. ... SelectionCriteria c = (SelectionCriteria) o; // BRJ: Outer join for OR boolean useOuterJoin = (crit.getType() == Criteria.OR); ... in the first query crit1 is the main criteria (not ORed) and is used to build the join, which will be an INNER join in this case. the OR-ed criteria crit2 does not influnce the join. in the second query crit1 is the OR-ed criteria and thus useOuterJoin is set to true resulting in an OUTER join. it looks like my solution to simply use an outer-join based on the curreent criteria was too simple :( may be we should check _all_ criteria instead. jakob Jakob Braeuchi wrote: hi oli, i could reproduce this behaviour with hsqldb and mysql, see attachement. but i do not yet know why the queries are reolved differently. jakob [EMAIL PROTECTED] wrote: Hello, I have a siutation where the two folloing snippets lead to non.equivalent queries: crit1.addOrCriteria(crit2); Query qry12 = new QueryByCriteria(BookArticle.class, crit1); vs crit2.addOrCriteria(crit1); Query qry21 = new QueryByCriteria(BookArticle.class, crit2); In our project, there is a situation in which these two queries (executed in a syabse database) result in different collections, but I have not mananged to reproduce this in the OJB test suite against HSQLDB. Nevertheless, I would like to know whether this is intended. Here are crit1 and crit2: Criteria crit1 = new Criteria(); crit1.addEqualTo("articleName", "Hamlet"); crit1.addEqualTo("productGroup.description", "Strange Books..."); Criteria crit2 = new Criteria(); crit2.addEqualTo("stock", new Integer(32)); The two resulting queries are: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR, A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand, A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten, A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) or, respectively: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR, A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand, A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten, A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) The difference is the type of the join (inner vs outer). In the sybase database, where a different join syntax is used, this may result in a different result set. Why does OJB use two different kinds of join here? According to the SQL standard, are these queries supposed to be equivalent? If so, is it a known bug in the sybase query engine? Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] MySQL - query12: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) query21: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) hsqldb -- query12: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) query21: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For addit
Re: Criteria.addOrCriteria() not commutative? (inner vs outer join)
hi oli, i could reproduce this behaviour with hsqldb and mysql, see attachement. but i do not yet know why the queries are reolved differently. jakob [EMAIL PROTECTED] wrote: Hello, I have a siutation where the two folloing snippets lead to non.equivalent queries: crit1.addOrCriteria(crit2); Query qry12 = new QueryByCriteria(BookArticle.class, crit1); vs crit2.addOrCriteria(crit1); Query qry21 = new QueryByCriteria(BookArticle.class, crit2); In our project, there is a situation in which these two queries (executed in a syabse database) result in different collections, but I have not mananged to reproduce this in the OJB test suite against HSQLDB. Nevertheless, I would like to know whether this is intended. Here are crit1 and crit2: Criteria crit1 = new Criteria(); crit1.addEqualTo("articleName", "Hamlet"); crit1.addEqualTo("productGroup.description", "Strange Books..."); Criteria crit2 = new Criteria(); crit2.addEqualTo("stock", new Integer(32)); The two resulting queries are: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR, A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand, A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten, A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) or, respectively: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR, A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand, A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten, A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) The difference is the type of the join (inner vs outer). In the sybase database, where a different join syntax is used, this may result in a different result set. Why does OJB use two different kinds of join here? According to the SQL standard, are these queries supposed to be equivalent? If so, is it a known bug in the sybase query engine? Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] MySQL - query12: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) query21: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) hsqldb -- query12: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 INNER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE (A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' OR (A0.Lagerbestand = '32' ) query21: SELECT A0.Einzelpreis,A0.Kategorie_Nr,A0.ISBN,A0.AUTHOR,A0.Auslaufartikel,A0.MindestBestand,A0.Lagerbestand,A0.Artikel_Nr,A0.Liefereinheit,A0.BestellteEinheiten,A0.Lieferanten_Nr,A0.Artikelname FROM BOOKS A0 LEFT OUTER JOIN Kategorien A1 ON A0.Kategorie_Nr=A1.Kategorie_Nr WHERE A0.Lagerbestand = '32' OR ((A0.Artikelname = 'Hamlet' ) AND A1.Beschreibung = 'Strange Books...' ) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
UPGRADE pb with proxi and getCollectionByQuery
All, I have this strange behaviours. When I call getCollectionByQuery I retrieve a collection of proxy objects. Now, I want to modify some attributes of these objects and after I lock with the UPGRADE mode and commit. No update is generated. The object is not make as dirty. Why ?? When I use getObjectByQuery I don't have the trouble my object is well updated!!! Any helps would be appreciated, this is driving me nuts! Tx ! Ps : I 'm using the : ObjectCacheClass=org.apache.ojb.broker.cache.ObjectCacheEmptyImpl
ConnectionfactoryPooledImpl in Weblogic, was rollback problem
No one answered this, but I did find my problem - I needed to set useAutoCommit="1" in my repository_database.xml file However, I need to understand something. If I am running in Weblogic, using a connection pooled data source, but NOT using EJBs, and NOT using JTA, is it safe to use ConnectionFactoryPooledImpl? Will this cause problems for me down the line? I am feeling very unsure of this configuration. thanks, Bonnie MacKellar -Original Message- From: Bonnie MacKellar Sent: Thursday, October 02, 2003 3:54 PM To: '[EMAIL PROTECTED] ' Subject: rollback problem Hi, I have a simple two step transaction, in which two inserts occur. I am using PB broker, with OJB transactions. I am connecting to a data source in Weblogic. I am using rc4. When a rollback occurs, the first record inserted in the transaction is not removed. This is very incorrect, of course. I looked back in the archives for this list, and found a message saying not to use ConnectionFactoryManagedImpl if you are using OJB transactions. Fine. So I switched to ConnectionFactoryPooledImpl. But the problem remains. Is there a known problem with this? My code is try { broker.beginTransaction(); broker.store(customer); broker.store(audit); broker.commitTransaction(); } catch (Exception e) { broker.abortTransaction(); logger.error(e.getMessage()); } } I am attaching my ojb.properties as well. Thanks, Bonnie MacKellar
RE: Strange null pointer exceptions
Hello Jan, > -Original Message- > From: Jan Berkel [mailto:[EMAIL PROTECTED] > I keep getting NullPointerExceptions while retrieving an object from > the database (OJB 1.0RC4). > my repository_user.xml is set up as explained in the tutorials > (extent-class in Template/BaseTemplate etc., to be sure I also used > ojbConcreteClass to specify the classname) Please post the repository_user.xml. I guess an attribute or field-descriptor is missing there. Another valuable hint could be a stacktrace with line numbers. In order to produce it, please rebuild OJB with bin\build.bat jar-debug (or bin/build.sh jar-debug) and then reproduce your problem. > What does "Skipping class [cabane.templates.MailTemplate]" mean ? > I could not figure it out by reading the code. I think it is an optimization in case several classes are mapped to the same table. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: build faild with postgres (hsql OK)
Hi Armin, your hint was _:-))_ The problem with the build for SAPDB was, that the tables must be created manually because of an error when trying to delete tables which didn't exist. If I create the tables before, then the script runs well. It should be described in the build-docs or be fixed. tx joerg Armin Waibel wrote: Hi Joerg, with current CVS head and sapdb all seems ok too (see below - 3 failures, errors are todo's). Please check the junit-log files. You can find them in db-ojb/target/test/test-xxx.txt regards, Armin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RC5
The biggest hold up right now is a slowdown in the ODMG code which is being investigated. Aside from that I *think* it is pretty close to gold. -Brian On Monday, October 6, 2003, at 10:51 AM, Gary wrote: Any idea of the dates of RC5, and/or a final version of the code? Gary __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RC5
Any idea of the dates of RC5, and/or a final version of the code? Gary __ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Build still fails: hanging on ojbtest-schema.sql (SAPDB)
hi, I updated to cvs-head now and still the build has some problems (hsqldb: OK) with _mysql_, the output is: junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 270, Failures: 7, Errors: 5, Time elapsed: 36,421 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/C:/sichten/db-ojb/target/test/ojb/OJB.properties [junit] Tests run: 164, Failures: 2, Errors: 0, Time elapsed: 8,031 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/C:/sichten/db-ojb/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 1,672 sec [junit] Running org.apache.ojb.otm.AllTests [junit] Tests run: 76, Failures: 0, Errors: 0, Time elapsed: 11,5 sec junit-no-compile: junit: BUILD SUCCESSFUL Total time: 1 minute 43 seconds though the output says: "successful", there are still failures and errors. But the main reason is: how can I get SAPDB running? with _sapdb_, the out put is: project-insert-sql: [torque-insert-sql] Our new url -> jdbc:sapdb:OJB [torque-insert-sql] Executing file: C:\sichten\db-ojb\target\src\sql\ojbtest-schema.sql [torque-insert-sql] Failed to execute: drop table Kategorien cascade [torque-insert-sql] com.sap.dbtech.jdbc.exceptions.DatabaseException: [-4004] (at 12): Unknown table name:KATEGORIEN the build freezes here:-( what can I do? tx joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can I use multiple Sequence Managers
Hi, Ok, I'll give that a try. fine I was thinking of something like Then persistence broker will check class-descriptor before defaulting to jdbc-connection's sequence manager. Are there any plans to introduce this/these feature(s)? Probably too late for 1.0? It's never too late for new features ;-) I thought about that and add this on my todo list, but priority set within the scope of 1.1 regards, Armin - Original Message - From: "Durham David Contr 805 CSPTS/SCBE" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]>; "Armin Waibel" <[EMAIL PROTECTED]> Sent: Wednesday, October 01, 2003 4:03 PM Subject: RE: Can I use multiple Sequence Managers ### Currently it's not supported (you can only define SequenceManager implementations on a per jdbc-connection-descriptor level), but you can easy write your own SequenceManager implementation to manage different SM implementations. Use custom 'attribute' elements in your field-descriptor to specify the different SM implementation classes and let your SM implementation manage the different instances. regards, Armin Ok, I'll give that a try. I was thinking of something like Then persistence broker will check class-descriptor before defaulting to jdbc-connection's sequence manager. Are there any plans to introduce this/these feature(s)? Probably too late for 1.0? Thanks, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Unwanted Proxy Materialization when obtaining ODMG READ lock
I posted this question a while ago and got no response so far: I am using the ODMG API (RC4 and CVS HEAD) with setting ImplicitLocking=false in OJB.properties. When I obtain a READ lock on an object that has proxy references, all proxies are getting materialized. Due to above setting, there are not even READ locks put on the referenced objects, so I wonder why this happens. Stepping through the code shows that this happens in the method assertFkAssignment in class TransactionImpl. This method gets called from assignReferenceFKs, which in turn gets called from the lock method. Is this really necessary at this point? I would be very glad to know a way to avoid this, as in my case materializing all references would be prohibitively expensive. Thanks for any hints! Gerhard
Re: build faild with postgres (hsql OK)
Hi Joerg, with current CVS head and sapdb all seems ok too (see below - 3 failures, errors are todo's). Please check the junit-log files. You can find them in db-ojb/target/test/test-xxx.txt regards, Armin [torque-insert-sql] 522 of 522 SQL statements executed successfully junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 270, Failures: 0, Errors: 1, Time elapsed: 110,188 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/E:/intellij/DB_OJB_CLEAN/db-ojb/target/test/ojb/OJB.properties [junit] Tests run: 164, Failures: 2, Errors: 0, Time elapsed: 18,487 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/E:/intellij/DB_OJB_CLEAN/db-ojb/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 2,984 sec [junit] Running org.apache.ojb.otm.AllTests [junit] Tests run: 76, Failures: 0, Errors: 0, Time elapsed: 17,315 sec On Mon, 06 Oct 2003 10:29:29 +0200, Joerg Lensing <[EMAIL PROTECTED]> wrote: hi all, is there a log-file for junit-tests? The test fails with postgres, but hslq is OK. This is the output to the console [torque-insert-sql] 365 of 367 SQL statements executed successfully junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 247, Failures: 20, Errors: 184, Time elapsed: 337,75 sec [junit] java.lang.OutOfMemoryError [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests tx joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
build faild with postgres (hsql OK)
hi all, is there a log-file for junit-tests? The test fails with postgres, but hslq is OK. This is the output to the console [torque-insert-sql] 365 of 367 SQL statements executed successfully junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 247, Failures: 20, Errors: 184, Time elapsed: 337,75 sec [junit] java.lang.OutOfMemoryError [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests tx joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB RC4 does not select all objects?
Hi again, because I did not get any reply for my postings I'm trying to get some information. What mean "side effect"? I'm running inside of jboss and without eager-releas='true' the datasource extends it's maximum limit. Why not all objects are selected and why without throwing any exception? Is there a workaround (instead of making a lot of primary key selects)? best regards, Guido Armin Waibel wrote: Hi Guido, this can be a side-effect of the eager-release attribute when set 'true'. Did you tried to run your test with 'false'? Or is your test successful in standalone OJB? regards, Armin - Original Message - From: "Guido Beutler" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, October 01, 2003 3:27 PM Subject: Re: OJB RC4 does not select all objects? Hi,, I tried a workaround and select all A by a loop with direct primary key access like: "select allobject from A where key=$1" Whith this select I get all expected objects but of course this is not very comfortable to code a loop for every IN clause. best regards, Guido Original Message Subject: OJB RC4 does not select all objects? Date: Wed, 01 Oct 2003 14:20:15 +0200 From: Guido Beutler <[EMAIL PROTECTED]> To: OJB Users List <[EMAIL PROTECTED] Hello, I've got a strange problem. I have two Tables A and B with corresponding classes. B has a foreign key to A and so I have a 1:N between A and B. A has a reference-descriptor to B and B has a collection-descriptor to A. If I try to select all instances of A i only get a few entries instead of 20. If I reinvoke the test case the number of retrieved objects raises until 20 is reached. "select allobject from A where key is in ($1)" $1 is a collection of 20 integers. If I select all objects of B first and then select all A i get the expected 20 objects. In both cases no exception is thrown. I'm using rc4 with ODMG inside of JBoss 3.2.2. with DB/2. Has anybody seen this before? gest regards, Guido - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with update in 1 to n relationship.
Hi, I am working with OJB on a purchase order 1 to n object on mysql database. When update the old PO with the new PO (same ID) with some lineitems deleted, it does not delete the Items in the database. It works correctly when the new PO with addition lineitems, it adds them to the db. but not vice versa. following is my repository_user.xml and my update code. class="src.SIP.PO" table="SHEET" > name="oid" column="ID" jdbc-type="VARCHAR" primarykey="true" /> name="status" column="STATUS" jdbc-type="VARCHAR" /> name="CreationDateTime" column="CreatedDate" jdbc-type="VARCHAR" /> name="Items" collection-class="org.apache.ojb.broker.util.collections.RemovalAwareCollection" element-class-ref="src.SIP.POItem" auto-delete="true" auto-retrieve="true" auto-update="true" > static public void UpdatePO1(String id, PO newpo) { Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); try { db.open("default", Database.OPEN_READ_WRITE); } catch (ODMGException ex) { ex.printStackTrace(); } String oqlQuery = "select upd from " + PO.class.getName() + " where oid = " + id; TransactionImpl tx = (TransactionImpl) odmg.newTransaction(); try{ tx.begin(); PersistenceBroker pb = tx.getBroker(); PO oldpo = getPO(id); tx.lock(oldpo, Transaction.WRITE); BeanUtils.copyProperties(oldpo, newpo); tx.commit(); } catch (Throwable t) { t.printStackTrace(); } } _ Instant message in style with MSN Messenger 6.0. Download it now FREE! http://msnmessenger-download.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cache and prefetched relationships
Hi Carlos, On Sunday 05 October 2003 14:37, carlos wrote: > broker.getCollectionByQuery(): Optimised prefetched relationships are only > useful if object caching is enabled. > > Also, using the default cache, it appears that any related objects obtained > by an optimised SQL IN() clause may be 'garbage collected' before being > assigned to the 'owning object', causing another database lookup at > assigment. I believe I've observed this behaviour retrieving many objects > (2000+) - Is this correct? Looking at the ReferencePrefetcher implememntation, I see that this is possible for references (not for collections). Also I see that this problem can be easily fixed. I'll do this. Thanks, Oleg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]