Re: Smart Count
Hi Olli, Thanks a lot! That´s exactly what I needed! :) Cheers [EMAIL PROTECTED] wrote: Hello Daniel, -Original Message- From: Daniel R. Ambrosio [mailto:[EMAIL PROTECTED] What would be the smarter way to do a count on an entity based on a criteria? I believe that getting the Collection (using getCollectionByQuery()) and then size() is not the best way to that using OJB is it? try PersistenceBroker.getCount(Query) HTH, Olli - 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]
How to handle constraint violations (ODMG)
Hi, I have USER table which containts a column 'email' which should be unique. When I try to write an object to the table using the ODMG api I can catch a TransactionAbortedException. How can I get to the SQL error code? I tried the following, which did not work: try { tx.commit(); } catch (TransactionAbortedException ex1) { Throwable ex = ex1.getCause(); if (ex instanceof PersistenceBrokerSQLException) { if (((PersistenceBrokerSQLException)ex).getSourceException() instanceof SQLException) { SQLException sex1 = (SQLException)((PersistenceBrokerSQLException)ex).getSourceException(); logger.info("Exception sql state: " + sex1.getSQLState() + ", " + sex1.getErrorCode() + ", " + sex1.toString()); } The sql state is null and the error code is 0. (I am using ojb 1.0RC4 and PostgreSQL 7.3). Best regards, Andreas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PersistenceBrokerFactory exception
Hi Carlos, seems the broker-pool is exhausted. OJB version? Do you mix PB-api and ODMG-api in your code? I don't mean > PersistenceBroker broker = ((HasBroker) tx).getBroker(); that's ok. I mean direct use of PersistenceBrokerFactory to create PB instances? Normally the odmg-api close all used PB instances after use. Or, you have to many concurrent threads running on the server. But default pool size is 100. So I think it's not as simple as that ;-) regards, Armin Boyes, Carl wrote: Hi, Our OJB based application has just gone into system test and we are intermittently experiencing the below error when calling: PersistenceBroker broker = ((HasBroker) tx).getBroker(); Can anyone let me know what I am doing wrong? Is there another way to get the broker from a transaction? Should I be calling any specific clean up method? As always any help would be much appreciated. [org.apache.ojb.odmg.TransactionImpl] ERROR: Cannot obtain PersistenceBroker from PersistenceBrokerFactory, found PBKey was org.apache.ojb.broker.PBKey: jcdAlias=Xdeals, user=gemini_object, password=* Borrow broker from pool failed java.util.NoSuchElementException at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye dObjectPool.java:758) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist enceBroker(PersistenceBrokerFactoryDefaultImpl.java:233) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Persi stenceBrokerFactory.java:131) at org.apache.ojb.odmg.TransactionImpl.getBroker(TransactionImpl.java:1201) Carlos. The contents of this email are confidential to the intended recipient at the email address to which it has been addressed. It may not be disclosed to or used by anyone other than this addressee, nor may it be copied in any way. If received in error, please contact DLA, a UK law firm, (http://www.dla.com/) on +44 (0) 8700 11 quoting the name of the sender and the addressee and then delete it from your system. Please note that neither DLA nor the sender accepts any responsibility for viruses and it is your responsibility to scan the email and attachments (if any). No contracts may be concluded on behalf of DLA by means of email communications. A list of the names of the partners of DLA (who are either solicitors or registered foreign lawyers) and their qualifications is available for inspection at 3 Noble Street, London, EC2V 7EE, UK. Regulated by the Law Society. - 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]
Mysql4.0?
Is MySQL 4.0 supported? I ran the regression tests against my database (/usr/sbin/mysqld Ver 4.0.14-standard for pc-linux on i686) and got the following: junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 247, Failures: 5, Errors: 2, Time elapsed: 41.511 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/gus/zip/db-ojb-1.0.rc4/target/test/ojb/OJB.properties [junit] Tests run: 160, Failures: 2, Errors: 0, Time elapsed: 11.521 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/gus/zip/db-ojb-1.0.rc4/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 2.474 sec [junit] Running org.apache.ojb.otm.AllTests [junit] Tests run: 73, Failures: 0, Errors: 0, Time elapsed: 14.209 sec when I tracked down the failing tests they turned out to be: in broker.AllTests: Testcase: testSubQuery2 took 0.056 sec Caused an ERROR Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT DISTINCT A0.Kategorie_Nr FROM Artikel A0)' at line 1" Testcase: testSubQuery2Testcase: testSubQuery1 took 0.018 sec Caused an ERROR Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT avg(A0.Einzelpreis) FROM Artikel A0 WHERE A0.Artikelname" Testcase: testReportPathExpressionForExtents2 took 0.005 sec FAILED Testcase: testDeleteWithRemovalAwareCollection took 0.018 sec FAILED Testcase: testUserRollbackClearCache took 0.299 sec FAILED Testcase: testUserRollbackClearCacheTestcase: testUserRollback took 0.198 sec FAILED Testcase: testUserRollbackTestcase: testRollback took 0.031 sec FAILED in odmg.AllTests: Testcase: testStoreThreePersons took 0.017 sec FAILED Testcase: testUserRollbackWithCheckpoint took 0.1 sec FAILED Are these known problems? Are they known to be harmless? or am I in trouble here? -Gus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New xdoclet ojb module version
I have been in contact with Erik Hatcher on XDoclet (he is also an Apache member) and he says that there is about 0% chance of getting it into XDoclet 1.2, and he doesn't expect that there will be a 2.0. He was open to putting an OJB module into the XDoclet 2.0 distribution if we can get someone to make and maintain it, but was of the opinion that we will need to host the XDoclet 1.X plugin if it is going to be hosted. I am all for putting it in our CVS as the plugin works very well and, imho, is one of the best ways to do repository configuration. XDoclet is BSD licensed so having code dependent on it in our CVS is okay. -Brian On Monday, November 10, 2003, at 10:53 AM, Thomas Dudziak wrote: I've created a new version of the xdoclet ojb module which now also supports the object-cache tag, and the factory-class, proxy-prefetching-limit and otm-dependent attributes. Thomas Mahler will be so kind to upload the module to the CVS sometime this week. I would have uploaded the changed source to the xdoclet JIRA (the module is still not part of the main tree, don't ask me, perhaps it would help if somebody requests it in the xdoclet users mailing list ...), but currently I can't because of some strange server problem. So anybody interested in the source should send me an email. Please note however that the source is in some sort of pre-refactoring stage until I have enough time to finish the unit tests and then refactor the module (necessary for some new features). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: wrong mapping in postgre
Hi Ramon, Try using VARBINARY or LONGVARBINARY as the type. BLOB maps to java.sql.Blob, but is not implemented on many jdbc drivers. Wally -Original Message- From: Ramon Cano Granizo [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 12:57 PM To: OJB Users List Subject: wrong mapping in postgre Hello, i'm trying insert a blob record in postgreSQL, but every time i get an SQLException, UnknownType. The repository_user.xml looks like In the class, it's mapped like a byte[], perhaps i'm making a wrong mapping?? Anyone knows a better way? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wrong mapping in postgre
Hello, i'm trying insert a blob record in postgreSQL, but every time i get an SQLException, UnknownType. The repository_user.xml looks like In the class, it's mapped like a byte[], perhaps i'm making a wrong mapping?? Anyone knows a better way? Thanks
Refresh attribute
Hello Everyone, Does the attribute "refresh" used in the class descriptor tag works only for the CachePerClass or does it work for all the provided Cache implementations that ships with OJB rc3?? thanks in advance for any help, Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error at run time by a beginner, next step
Hi Excuse me the first line of error message was missing : now it is complete : Thank's for any help Andre Now I get : [BOOT] WARN: Value "org.apache.ojb.odmg.locking.InMemoryLockMapImpl" is illegal for key "LockMapClass" (should be a class, using default value org.apache.ojb.odmg.locking.PersistentLockMapImpl) java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultKey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source) [EMAIL PROTECTED] wrote: Hello, -Original Message- From: A Leg [mailto:[EMAIL PROTECTED] [..] [BOOT] ERROR: Cannot get OJB properties file, use default settings! you should start by fixing that one. Make sure that the directory that contains your file OJB.properties (to be found in db-ojb/src/test/org/apache/ojb/) is in your classpath. Olli - 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]
PersistenceBrokerFactory exception
Hi, Our OJB based application has just gone into system test and we are intermittently experiencing the below error when calling: PersistenceBroker broker = ((HasBroker) tx).getBroker(); Can anyone let me know what I am doing wrong? Is there another way to get the broker from a transaction? Should I be calling any specific clean up method? As always any help would be much appreciated. [org.apache.ojb.odmg.TransactionImpl] ERROR: Cannot obtain PersistenceBroker from PersistenceBrokerFactory, found PBKey was org.apache.ojb.broker.PBKey: jcdAlias=Xdeals, user=gemini_object, password=* Borrow broker from pool failed java.util.NoSuchElementException at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeye dObjectPool.java:758) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.createPersist enceBroker(PersistenceBrokerFactoryDefaultImpl.java:233) at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Persi stenceBrokerFactory.java:131) at org.apache.ojb.odmg.TransactionImpl.getBroker(TransactionImpl.java:1201) Carlos. The contents of this email are confidential to the intended recipient at the email address to which it has been addressed. It may not be disclosed to or used by anyone other than this addressee, nor may it be copied in any way. If received in error, please contact DLA, a UK law firm, (http://www.dla.com/) on +44 (0) 8700 11 quoting the name of the sender and the addressee and then delete it from your system. Please note that neither DLA nor the sender accepts any responsibility for viruses and it is your responsibility to scan the email and attachments (if any). No contracts may be concluded on behalf of DLA by means of email communications. A list of the names of the partners of DLA (who are either solicitors or registered foreign lawyers) and their qualifications is available for inspection at 3 Noble Street, London, EC2V 7EE, UK. Regulated by the Law Society. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: New xdoclet ojb module version
Thank you! Consider it requested for the xdoclet trunk. I will go subscribe to xdoclet-user just to request this. The plugin is wonderful! -Brian On Monday, November 10, 2003, at 10:53 AM, Thomas Dudziak wrote: I've created a new version of the xdoclet ojb module which now also supports the object-cache tag, and the factory-class, proxy-prefetching-limit and otm-dependent attributes. Thomas Mahler will be so kind to upload the module to the CVS sometime this week. I would have uploaded the changed source to the xdoclet JIRA (the module is still not part of the main tree, don't ask me, perhaps it would help if somebody requests it in the xdoclet users mailing list ...), but currently I can't because of some strange server problem. So anybody interested in the source should send me an email. Please note however that the source is in some sort of pre-refactoring stage until I have enough time to finish the unit tests and then refactor the module (necessary for some new features). Tom - 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]
New xdoclet ojb module version
I've created a new version of the xdoclet ojb module which now also supports the object-cache tag, and the factory-class, proxy-prefetching-limit and otm-dependent attributes. Thomas Mahler will be so kind to upload the module to the CVS sometime this week. I would have uploaded the changed source to the xdoclet JIRA (the module is still not part of the main tree, don't ask me, perhaps it would help if somebody requests it in the xdoclet users mailing list ...), but currently I can't because of some strange server problem. So anybody interested in the source should send me an email. Please note however that the source is in some sort of pre-refactoring stage until I have enough time to finish the unit tests and then refactor the module (necessary for some new features). Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB as JDO implementation: status request
Right now there are two JDO implementations in OJB. The one that works is dependent upon the JDO reference implementation so it not always an acceptable option. This one works by using OJB as a plugin back end to the reference implementation. It is full compatible but not fully convenient (right now it requires maintaining .jdo and the repository_user.xml both). The licensing issue is also a potential problem as you have to contact Sun and ask permission to use the JDORI for commercial production use. Everyone I know of who has asked has received permission. The second implementation is the OJB-native implementation. If your release target is anytime soon, don't use this yet. Many functions are still just stubs. Everything that we need to finish putting together the OJB-native JDO impl is in place -- locking down bugs and boosting performance for 1.0 has just been higher priority than filling in the stubs for JDO. -Brian On Monday, November 10, 2003, at 10:39 AM, Sergey V. Oudaltsov wrote: Hello folks We are starting some project and would love to use some JDO implementation. We like ojb (well, just looking at the docs and the site:) - but concerned about the level of compatibility with Sun specs. We could not find any info on that subject on the web site - so could please anyone give any comments on this? I know, currently it is only a plugin - but is there any "compatibility status" for it? Thanks in advance, -- Sergey - 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]
Error at run time by a beginner, next step
Hi I put the OJB.properties file. And it seems to find it because the error desappear. Now I get this, and to be honnest I don't see what could be the problem. Thank's for any help Andre Now I get : java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultKey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source) [EMAIL PROTECTED] wrote: Hello, -Original Message- From: A Leg [mailto:[EMAIL PROTECTED] [..] [BOOT] ERROR: Cannot get OJB properties file, use default settings! you should start by fixing that one. Make sure that the directory that contains your file OJB.properties (to be found in db-ojb/src/test/org/apache/ojb/) is in your classpath. Olli - 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]
OJB as JDO implementation: status request
Hello folks We are starting some project and would love to use some JDO implementation. We like ojb (well, just looking at the docs and the site:) - but concerned about the level of compatibility with Sun specs. We could not find any info on that subject on the web site - so could please anyone give any comments on this? I know, currently it is only a plugin - but is there any "compatibility status" for it? Thanks in advance, -- Sergey - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RE : Error at run time by a beginner
Thank's Oliver, merci Emmanuel. It' realy a beginer mistake. Andre Emmanuel Dupont wrote: Y're OJB.properties file is not present. -Message d'origine- De : A Leg [mailto:[EMAIL PROTECTED] Envoyé : lundi 10 novembre 2003 16:18 À : [EMAIL PROTECTED] Objet : Error at run time by a beginner Hi I make my first try, so I arrive to compile and to run it, but it fail somewhere. I use the presistent broker, only. and I use the same Product base than the tutorial one. Does somebody understand where is my mistake ? Andre [BOOT] ERROR: Cannot get OJB properties file, use default settings! [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: Create PersistenceBroker instance pool, pool configuration was {whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=60, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=false} [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB Descriptor Repository: file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml Got new Event to crunch on EventRelayer [1] leaving [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=20) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=autoNaming, value=true) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceId, value=false) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceStart, value=1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=5) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key1, value=value1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key2, value=value2) but I could not assign them to a descriptor java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultK ey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknow n Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces sorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc torAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn own Source) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic proxies (simple question)
Hi, >>Perhaps you should look at using proxies on your collections first This would be a nice idea, but the problem is, that if i am right about what is taking time, it is the updating of a set of objects. When a page is submitted, each of about 30 objects are loaded, updated, stored, and the cache cleared. The problem here is that each of these objects is referencing two objects, which will each cause the loading of hundreds of other objects. If i can proxy these two references, i think it will almost completely solve the problem on it's own. I think i understand proxying now, (the interface requirement makes a LOT of sense once you know what you've got to do and try to think why!) Thanks to everyone on this list for all your help, and patience. Daniel. - Original Message - From: "Gelhar, Wallace Joseph" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 3:13 PM Subject: RE: dynamic proxies (simple question) Hi Daniel, Perhaps you should look at using proxies on your collections first (this will require no refactoring, just add proxy="true" to your collection descriptors) and then possible proxy your references (requires interface) before looking at using dynamic proxies on all classes. This seems to be the concept that works well in many cases. Wally -Original Message- From: Daniel Perry [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 8:56 AM To: OJB Users List Subject: Re: dynamic proxies (simple question) Thanks for the reply. While waiting for someone to respond, i thought i'd give the "one simple interface" a quick go Sadly it doesnt work :) Oh well, eclipses refactoring tools will come in handy! A quick question regarding inherritance (assuming I[beanname] are interfaces to bean properties): Job extends BaseBO. BaseBO implements IBaseBO. IJob only interfaces the extra methods in Job over BaseBO. OJB doesnt know about the inherritance (ie it knows nothing about BaseBO). getId is only interfaced in IBaseBO. Do i need to do anything more? eg... Should IJob extend IBaseBO? Should Job implement IBaseBO? Thanks, Daniel. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 2:33 PM Subject: RE: dynamic proxies (simple question) > Hello Daniel, > > > -Original Message- > > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > > So my solution would seem to be proxies. The tutorial on dynamic > > proxies isn't too clear. It says: > > > > "To use dynamic proxies the persistent class in question (in our > > case the Article class) must implement an interface (for example > > InterfaceArticle). This interface is needed to allow replacement of > > the proper Article object with a dynamic proxy implementing the same > > interface." > > > > My question is: what must this interface provide? > > I agree that this above text is not clear about this. > > The answer is: the interface must provide all methods > your application needs to invoke. Typically these are > all non-private methods of your BO. > > > Nearly all my BOs (all that i want to proxy) are subclasses the > > BaseBO bean (with two properties - deleted and id). Can i create an > > interface with just these two methods, or do > > If you try that and then change the types of all member variables to > that interface, the compiler will certainly complain. > > > i have to create an interface for each bean, with all methods in it? > > Yes, this is probably what you should do. > > Olli > > - > 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error at run time by a beginner
Hello, > -Original Message- > From: A Leg [mailto:[EMAIL PROTECTED] [..] > [BOOT] ERROR: Cannot get OJB properties file, use default settings! you should start by fixing that one. Make sure that the directory that contains your file OJB.properties (to be found in db-ojb/src/test/org/apache/ojb/) is in your classpath. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE : Error at run time by a beginner
Y're OJB.properties file is not present. -Message d'origine- De : A Leg [mailto:[EMAIL PROTECTED] Envoyé : lundi 10 novembre 2003 16:18 À : [EMAIL PROTECTED] Objet : Error at run time by a beginner Hi I make my first try, so I arrive to compile and to run it, but it fail somewhere. I use the presistent broker, only. and I use the same Product base than the tutorial one. Does somebody understand where is my mistake ? Andre [BOOT] ERROR: Cannot get OJB properties file, use default settings! [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: Create PersistenceBroker instance pool, pool configuration was {whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=60, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=false} [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB Descriptor Repository: file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml Got new Event to crunch on EventRelayer [1] leaving [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=20) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=autoNaming, value=true) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceId, value=false) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceStart, value=1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=5) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key1, value=value1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key2, value=value2) but I could not assign them to a descriptor java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultK ey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknow n Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces sorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstruc torAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unkn own Source) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic proxies (simple question)
Hi Daniel, Perhaps you should look at using proxies on your collections first (this will require no refactoring, just add proxy="true" to your collection descriptors) and then possible proxy your references (requires interface) before looking at using dynamic proxies on all classes. This seems to be the concept that works well in many cases. Wally -Original Message- From: Daniel Perry [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 8:56 AM To: OJB Users List Subject: Re: dynamic proxies (simple question) Thanks for the reply. While waiting for someone to respond, i thought i'd give the "one simple interface" a quick go Sadly it doesnt work :) Oh well, eclipses refactoring tools will come in handy! A quick question regarding inherritance (assuming I[beanname] are interfaces to bean properties): Job extends BaseBO. BaseBO implements IBaseBO. IJob only interfaces the extra methods in Job over BaseBO. OJB doesnt know about the inherritance (ie it knows nothing about BaseBO). getId is only interfaced in IBaseBO. Do i need to do anything more? eg... Should IJob extend IBaseBO? Should Job implement IBaseBO? Thanks, Daniel. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 2:33 PM Subject: RE: dynamic proxies (simple question) > Hello Daniel, > > > -Original Message- > > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > > So my solution would seem to be proxies. The tutorial on dynamic > > proxies isn't too clear. It says: > > > > "To use dynamic proxies the persistent class in question (in our > > case the Article class) must implement an interface (for example > > InterfaceArticle). This interface is needed to allow replacement of > > the proper Article object with a dynamic proxy implementing the same > > interface." > > > > My question is: what must this interface provide? > > I agree that this above text is not clear about this. > > The answer is: the interface must provide all methods > your application needs to invoke. Typically these are > all non-private methods of your BO. > > > Nearly all my BOs (all that i want to proxy) are subclasses the > > BaseBO bean (with two properties - deleted and id). Can i create an > > interface with just these two methods, or do > > If you try that and then change the types of all member variables to > that interface, the compiler will certainly complain. > > > i have to create an interface for each bean, with all methods in it? > > Yes, this is probably what you should do. > > Olli > > - > 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]
Error at run time by a beginner
Hi I make my first try, so I arrive to compile and to run it, but it fail somewhere. I use the presistent broker, only. and I use the same Product base than the tutorial one. Does somebody understand where is my mistake ? Andre [BOOT] ERROR: Cannot get OJB properties file, use default settings! [org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl] INFO: Create PersistenceBroker instance pool, pool configuration was {whenExhaustedAction=0, maxIdle=-1, maxActive=21, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=false, minEvictableIdleTimeMillis=60, testOnReturn=false, logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=false} [org.apache.ojb.broker.metadata.RepositoryPersistor] INFO: OJB Descriptor Repository: file:/home/Absynt/Compiere/mfg_scm/sbin/repository.xml Got new Event to crunch on EventRelayer [1] leaving [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=20) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=autoNaming, value=true) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceId, value=false) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=globalSequenceStart, value=1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=grabSize, value=5) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key1, value=value1) but I could not assign them to a descriptor [org.apache.ojb.broker.metadata.RepositoryXmlHandler] INFO: Found attribute (name=key2, value=value2) but I could not assign them to a descriptor java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefaultKey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:308) at java.lang.Class.newInstance(Class.java:261) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.(Unknown Source) at org.apache.ojb.broker.PersistenceBrokerFactory.defaultPersistenceBroker(Unknown Source) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic proxies (simple question)
Hello, > -Original Message- > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > One more question: > > In the class employee i have > private Job job; > > If i proxy this Job reference, should it become: > private IJob job; // where IJob is an interface to Job class. yes. > So, if i understand correctly: > The interface must have ALL prottypes in it. So to answer my > last email, > IJob should extens IBaseBO. > Any classes should reference the interface, not the object it is > representing. I should type things as IJob, not Job. > > Am i right? Yes, you are. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic proxies (simple question)
One more question: In the class employee i have private Job job; If i proxy this Job reference, should it become: private IJob job; // where IJob is an interface to Job class. So, if i understand correctly: The interface must have ALL prottypes in it. So to answer my last email, IJob should extens IBaseBO. Any classes should reference the interface, not the object it is representing. I should type things as IJob, not Job. Am i right? Thanks, Daniel. - Original Message - From: "Daniel Perry" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 2:56 PM Subject: Re: dynamic proxies (simple question) > Thanks for the reply. > While waiting for someone to respond, i thought i'd give the "one simple > interface" a quick go > Sadly it doesnt work :) > > Oh well, eclipses refactoring tools will come in handy! > > A quick question regarding inherritance (assuming I[beanname] are interfaces > to bean properties): > Job extends BaseBO. > BaseBO implements IBaseBO. > IJob only interfaces the extra methods in Job over BaseBO. > > OJB doesnt know about the inherritance (ie it knows nothing about BaseBO). > getId is only interfaced in IBaseBO. Do i need to do anything more? > eg... > Should IJob extend IBaseBO? > Should Job implement IBaseBO? > > Thanks, > Daniel. > > - Original Message - > From: <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Monday, November 10, 2003 2:33 PM > Subject: RE: dynamic proxies (simple question) > > > > Hello Daniel, > > > > > -Original Message- > > > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > > > > So my solution would seem to be proxies. The tutorial on > > > dynamic proxies isn't too clear. It says: > > > > > > "To use dynamic proxies the persistent class in question (in > > > our case the Article class) must implement an interface (for > > > example InterfaceArticle). This interface is needed to allow > > > replacement of the proper Article object with a dynamic proxy > > > implementing the same interface." > > > > > > My question is: what must this interface provide? > > > > I agree that this above text is not clear about this. > > > > The answer is: the interface must provide all methods > > your application needs to invoke. Typically these are > > all non-private methods of your BO. > > > > > Nearly all my BOs (all that i want to proxy) are subclasses > > > the BaseBO bean (with two properties - deleted and id). > > > Can i create an interface with just these two methods, or do > > > > If you try that and then change the types of all member > > variables to that interface, the compiler will certainly > > complain. > > > > > i have to create an interface for each bean, with all methods in it? > > > > Yes, this is probably what you should do. > > > > Olli > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic proxies (simple question)
Hello Daniel, > -Original Message- > A quick question regarding inherritance (assuming I[beanname] > are interfaces > to bean properties): > Job extends BaseBO. > BaseBO implements IBaseBO. > IJob only interfaces the extra methods in Job over BaseBO. > > OJB doesnt know about the inherritance (ie it knows nothing > about BaseBO). That is fine. But make sure that the class-descriptor of Job also has field-descriptors for the fields in BaseBO. > getId is only interfaced in IBaseBO. Do i need to do anything more? > eg... > Should IJob extend IBaseBO? Probably yes, because otherwise you cannot call method getId on a variable declared as IJob. > Should Job implement IBaseBO? It does (indirectly) because it extends BaseBO which in turn implements IBaseBO. That will do. HTH, Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic proxies (simple question)
Thanks for the reply. While waiting for someone to respond, i thought i'd give the "one simple interface" a quick go Sadly it doesnt work :) Oh well, eclipses refactoring tools will come in handy! A quick question regarding inherritance (assuming I[beanname] are interfaces to bean properties): Job extends BaseBO. BaseBO implements IBaseBO. IJob only interfaces the extra methods in Job over BaseBO. OJB doesnt know about the inherritance (ie it knows nothing about BaseBO). getId is only interfaced in IBaseBO. Do i need to do anything more? eg... Should IJob extend IBaseBO? Should Job implement IBaseBO? Thanks, Daniel. - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, November 10, 2003 2:33 PM Subject: RE: dynamic proxies (simple question) > Hello Daniel, > > > -Original Message- > > From: Daniel Perry [mailto:[EMAIL PROTECTED] > > > So my solution would seem to be proxies. The tutorial on > > dynamic proxies isn't too clear. It says: > > > > "To use dynamic proxies the persistent class in question (in > > our case the Article class) must implement an interface (for > > example InterfaceArticle). This interface is needed to allow > > replacement of the proper Article object with a dynamic proxy > > implementing the same interface." > > > > My question is: what must this interface provide? > > I agree that this above text is not clear about this. > > The answer is: the interface must provide all methods > your application needs to invoke. Typically these are > all non-private methods of your BO. > > > Nearly all my BOs (all that i want to proxy) are subclasses > > the BaseBO bean (with two properties - deleted and id). > > Can i create an interface with just these two methods, or do > > If you try that and then change the types of all member > variables to that interface, the compiler will certainly > complain. > > > i have to create an interface for each bean, with all methods in it? > > Yes, this is probably what you should do. > > Olli > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic proxies (simple question)
Hello Daniel, > -Original Message- > From: Daniel Perry [mailto:[EMAIL PROTECTED] > So my solution would seem to be proxies. The tutorial on > dynamic proxies isn't too clear. It says: > > "To use dynamic proxies the persistent class in question (in > our case the Article class) must implement an interface (for > example InterfaceArticle). This interface is needed to allow > replacement of the proper Article object with a dynamic proxy > implementing the same interface." > > My question is: what must this interface provide? I agree that this above text is not clear about this. The answer is: the interface must provide all methods your application needs to invoke. Typically these are all non-private methods of your BO. > Nearly all my BOs (all that i want to proxy) are subclasses > the BaseBO bean (with two properties - deleted and id). > Can i create an interface with just these two methods, or do If you try that and then change the types of all member variables to that interface, the compiler will certainly complain. > i have to create an interface for each bean, with all methods in it? Yes, this is probably what you should do. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dynamic proxies (simple question)
I've been using OJB for a month or so and am pretty impressed with it! However, with the application getting complicated, updating a bunch of objects is taking a long time - i'm assuming this is because each time it is loading the whole tree of interconnected objects! So my solution would seem to be proxies. The tutorial on dynamic proxies isn't too clear. It says: "To use dynamic proxies the persistent class in question (in our case the Article class) must implement an interface (for example InterfaceArticle). This interface is needed to allow replacement of the proper Article object with a dynamic proxy implementing the same interface." My question is: what must this interface provide? Nearly all my BOs (all that i want to proxy) are subclasses the BaseBO bean (with two properties - deleted and id). Can i create an interface with just these two methods, or do i have to create an interface for each bean, with all methods in it? Thanks, Daniel.
Re: Question about getIteratorByQuery
A Leg dijo: > You mean that the ojb iterator work exactly in the same the database > iterator works, taking in count the caching issues ? yep. Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question about getIteratorByQuery
Thomas You mean that the ojb iterator work exactly in the same the database iterator works, taking in count the caching issues ? Excuse me to ask for details, but for my use it is important. Andre Mahler Thomas wrote: Hi again, -Original Message- From: A Leg [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 9:17 AM To: OJB Users List Subject: Re: Question about getIteratorByQuery Thomas Thanks for you answer. Ok for a simple database call, but when we make this call to the persistence layer, which bring data step by step does it works ? I make a request on some table with 3 enreg numbers 1, 2 and 5 I ask some iterator at the prsistence layer. And make next. Somebody create a new enreg : the number for When I make next from the number 2. Will I get the number 4 or the number 5 ? It really depends on the isolation level supported by your database! It's not dependend on any OJB features. - Thomas Thanks for any help. Andre Thomas Mahler wrote: Hi Andre, To follow an index you'll need an order by clause for the indexed column. (http://db.apache.org/ojb/api/org/apache/ojb/broker/query/Crit eria.html#addOrderBy(java.lang.String,%20boolean)) If you do not use an order by clause the RDBMS is not forced to serve rows in a certain sequence. cu, Thomas A Leg wrote: Hi When we use *getIteratorByQuery and .next(). * do we move throw the table following the index or in some random order ? If we go in random order, what is the best way (getting advantage of the cache) to iterate in a table following the index ? Thank's Andre - 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] - 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]
Split table into many classes ???
Hello I 'm trying to split a table into many classes which are containing only a part of the datas . TABLE TT: NUMBER ID VARCHAR NAME VARCHAR DESCR BLOBDATA I want to have 2 classes one containing a small description ( ID , NAME and DESCR) and the other one Containing the data ( ID and BLOB ) It's easy to do it in the repository My problem is when I try to load all the ttdescription, the BROKER generate a request which is also containing the fields described in the ttData instead of limiting the select to the values of the column in ttdescription. Is it normal ? Do I have to manualy change the query for removing the not pertinent columns ? I'm using the cvs source of Ojb in the front of a Oracle 9i DB . B.R Thierry -Original Message- From: A Leg [mailto:[EMAIL PROTECTED] Sent: Monday, November 10, 2003 9:23 AM To: OJB Users List Subject: Re: problem with tutorial part 4 example Thomas Thank's again Thomas I got it yesterday on the Sun web site. The Antonio link is the good one. To keep going I will download the 1.0. Cheers Andre Thomas Mahler wrote: > Hi again Andre, > > Where exactly di you get this 1.0.1 version? > > Our stuff was build against the 1.0 version > (jdori-1_0-fcs-src-04_Mar_2002.zip): > http://jcp.org/aboutJava/communityprocess/final/jsr012/index.html > > Please point me to the 1.0.1 release and I'll check if there are any > compilation problems. > > cu, > Thomas > > A Leg wrote: > >> Hi >> >> I am learning ojb and for that, first looking tutorials and running >> examples. >> >> I have dowladed from Sun jdo-1_0_1-ri.zip >> And copy all jar under db-ojb-1.0.rc4/lib >> >> When I want to compile the JDO example I get : >> >> bin/build.sh with-jdori prepare-tutorials enhance-jdori >> Buildfile: build.xml >> >> splash: >> >> set-archive-name: >> >> set-archive-name-date: >> >> detect-jdk: >> >> check-jdk12proxy-classes: >> >> check-jndi-classes: >> >> use-jdk12: >> >> use-jdk13: >> >> use-jdk14: >> [echo] detected JDK 1.4 >> >> init: >> >> prepare: >> [copy] Copying 4 files to >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/srctest >> >> check-jdo-classes: >> >> check-jdori-classes: >> >> with-jdori: >> [copy] Copying 16 files to >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src >> [copy] Copying 1 file to >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/tu torial5 >> >> >> splash: >> >> set-archive-name: >> >> set-archive-name-date: >> >> detect-jdk: >> >> check-jdk12proxy-classes: >> >> check-jndi-classes: >> >> use-jdk12: >> >> use-jdk13: >> >> use-jdk14: >> [echo] detected JDK 1.4 >> >> init: >> >> prepare: >> >> check-j2ee-classes: >> >> preprocess: >> [echo] using switches: +JDK13, +JDBC30 >> [java] >> >> >> [java] >> ... >> >> >> main: >> [javac] Compiling 564 source files to >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/classes >> [javac] >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jd ori/sql/OjbStoreManager.java:76: >> cannot resolve symbol >> [javac] symbol : class RuntimeJDOModelFactoryImpl >> [javac] location: package jdo >> [javac] import >> com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; >> [javac] ^ >> [javac] >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jd ori/sql/OjbStoreManager.java:80: >> cannot resolve symbol >> [javac] symbol : class JDOModelException >> [javac] location: package jdo >> [javac] import com.sun.jdori.model.jdo.JDOModelException; >> [javac] ^ >> [javac] >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jd ori/sql/OjbFieldManager.java:64: >> cannot resolve symbol >> [javac] symbol : class RuntimeJDOModelFactoryImpl >> [javac] location: package jdo >> [javac] import >> com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; >> [javac] ^ >> [javac] >> /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jd ori/sql/OjbFieldManager.java:68: >> cannot resolve symbol >> [javac] symbol : class JDOMo
RE: Use stored procedure for insert questions
Hi again Thanks a lot for your answer but it's still not working The broker refuse to insert the instance because there is no sequence manager. Here is the stored procedure : PROCEDURE ADDINSTANCE ( IID OUT twtinstance.id%NUMBER , ITAG IN twtinstance.tag%CHAR , INAME IN twtinstance.name%CHAR , IOWNER IN twtinstance.UpdatePri%NUMBER , IWID IN twtinstance.WID%CHAR , ISRCID IN twtinstance.SourceId%NUMBER , ILOCID IN twtinstance.LocationId%NUMBER , ICFGID IN twtinstance.ConfigId%NUMBER , IZID IN twtinstance.ZoneId%NUMBER ) IS aInsId NUMBER; BEGIN SELECT twtinstances_id_seq.NEXTVAL INTO aInsId FROM dual; -- Insert the instance itself INSERT INTO twtInstances (Id, State, DataSync, SourceId, WID, LocationId, Name, ZoneId, ConfigId, UpdatePri, Tag) VALUES (aInsId, 0, 1, ISRCID, IWID, ILOCID, INAME, IZID, ICFGID, IOWNER, ITAG) RETURNING Id INTO IID; END ADDINSTANCE; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2003 5:12 PM To: [EMAIL PROTECTED] Subject: RE: Use stored procedure for insert questions Based on the configuration of the 'insert-procedure' descriptor that you provided earlier, here's the syntax of a procedure that 'should' work. Please not that the compiler on my email editor is not working right now, so I have no way of confirming if the syntax is correct. However, the basic structure is correct. CREATE OR REPLACE PROCEDURE ADDINSTANCE ( aID OUT TWTINSTANCES.ID%TYPE , aDESCRIPTION IN TWTINSTANCES.DESCRIPTION%TYPE , aDATASYNCIN TWTINSTANCES.DATASYNC%TYPE , aCONFIGIDIN TWTINSTANCES.CONFIGID%TYPE) IS BEGIN -- Get next value from the sequence -- This will put the value in the 'out' parameter named aID SELECT .NEXTVAL INTO aID FROM DUAL; -- Insert the record INSERT INTO TWTINSTANCES (ID, DESCRIPTION, DATASYNC, CONFIGID) VALUES (aID, aDESCRIPTION, aDATASYNC, aCONFIGID); END; HTH Ron Gallagher Atlanta, GA [EMAIL PROTECTED] -Original Message- From: Thierry Hanot [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2003 10:58 AM To: 'OJB Users List' Subject: RE: Use stored procedure for insert questions Thanks But how to do it , because there is no documentation on it ??? I probably did a wrong descriptor on the insert-procedure . B.R Thierry -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2003 4:31 PM To: [EMAIL PROTECTED] Subject: RE: Use stored procedure for insert questions Thierry -- You shouldn't need to use a sequence manager since the SP is assigning the id. Based on the configuration of the 'insert-procedure' descriptor, the first argument to the sp will be defined as either 'OUT' or 'IN OUT'. In either case, the value that's returned by the sp will be placed in the 'id' attribute on the 'Twtinstances' class. HTH Ron Gallagher Atlanta, GA [EMAIL PROTECTED] -Original Message- From: Thierry Hanot [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2003 10:20 AM To: 'OJB Users List' Subject: Use stored procedure for insert questions Hello All I currently trying to use the cvs version of ojb 1.0 with an Oracle 9i Database and I have a few problem with stored procedure and sequences: 1: I want to Stored procedure for insert some rows. The stored procedure return the id ( primary key ) of the row.But i don't know wich sequence manager i need to use for managing this class . Here is the class descriptor: But i don't find any way to use it correctly in ojb . First i didn't define any sequence manager , the PB refuse to insert any instance . Second try : using the SequenceManagerNativeImpl ( not implemented for this plateform ). 2: One other question concern the repository.dtd wich has the following lines on the stored procedures: A procedure cou
RE: Question about getIteratorByQuery
Hi again, > -Original Message- > From: A Leg [mailto:[EMAIL PROTECTED] > Sent: Monday, November 10, 2003 9:17 AM > To: OJB Users List > Subject: Re: Question about getIteratorByQuery > > > Thomas > > Thanks for you answer. > Ok for a simple database call, but when we make this call to the > persistence layer, which bring data step by step does it works ? > > I make a request on some table with 3 enreg numbers 1, 2 and 5 > I ask some iterator at the prsistence layer. > > And make next. > > Somebody create a new enreg : the number for > > When I make next from the number 2. Will I get the number 4 or the > number 5 ? It really depends on the isolation level supported by your database! It's not dependend on any OJB features. - Thomas > > Thanks for any help. > > Andre > > Thomas Mahler wrote: > > > Hi Andre, > > > > To follow an index you'll need an order by clause for the indexed > > column. > > > (http://db.apache.org/ojb/api/org/apache/ojb/broker/query/Crit eria.html#addOrderBy(java.lang.String,%20boolean)) > > > If you do not use an order by clause the RDBMS is not forced to serve > rows in a certain sequence. > > cu, > Thomas > > A Leg wrote: > >> Hi >> >> When we use *getIteratorByQuery and .next(). >> * do we move throw the table following the index or in some random >> order ? >> >> If we go in random order, what is the best way (getting advantage of >> the cache) to iterate in a table following the index ? >> >> Thank's >> >> Andre >> >> >> - >> 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with tutorial part 4 example
Thomas Thank's again Thomas I got it yesterday on the Sun web site. The Antonio link is the good one. To keep going I will download the 1.0. Cheers Andre Thomas Mahler wrote: Hi again Andre, Where exactly di you get this 1.0.1 version? Our stuff was build against the 1.0 version (jdori-1_0-fcs-src-04_Mar_2002.zip): http://jcp.org/aboutJava/communityprocess/final/jsr012/index.html Please point me to the 1.0.1 release and I'll check if there are any compilation problems. cu, Thomas A Leg wrote: Hi I am learning ojb and for that, first looking tutorials and running examples. I have dowladed from Sun jdo-1_0_1-ri.zip And copy all jar under db-ojb-1.0.rc4/lib When I want to compile the JDO example I get : bin/build.sh with-jdori prepare-tutorials enhance-jdori Buildfile: build.xml splash: set-archive-name: set-archive-name-date: detect-jdk: check-jdk12proxy-classes: check-jndi-classes: use-jdk12: use-jdk13: use-jdk14: [echo] detected JDK 1.4 init: prepare: [copy] Copying 4 files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/srctest check-jdo-classes: check-jdori-classes: with-jdori: [copy] Copying 16 files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src [copy] Copying 1 file to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/tutorial5 splash: set-archive-name: set-archive-name-date: detect-jdk: check-jdk12proxy-classes: check-jndi-classes: use-jdk12: use-jdk13: use-jdk14: [echo] detected JDK 1.4 init: prepare: check-j2ee-classes: preprocess: [echo] using switches: +JDK13, +JDBC30 [java] [java] ... main: [javac] Compiling 564 source files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/classes [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:76: cannot resolve symbol [javac] symbol : class RuntimeJDOModelFactoryImpl [javac] location: package jdo [javac] import com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:80: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: package jdo [javac] import com.sun.jdori.model.jdo.JDOModelException; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:64: cannot resolve symbol [javac] symbol : class RuntimeJDOModelFactoryImpl [javac] location: package jdo [javac] import com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:68: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: package jdo [javac] import com.sun.jdori.model.jdo.JDOModelException; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:252: cannot resolve symbol [javac] symbol : variable RuntimeJDOModelFactoryImpl [javac] location: class org.apache.ojb.jdori.sql.OjbStoreManager [javac] JDOModel m = RuntimeJDOModelFactoryImpl.getInstance().getJDOModel(cl); [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:255: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: class org.apache.ojb.jdori.sql.OjbStoreManager [javac] catch (JDOModelException ex) [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:289: cannot resolve symbol [javac] symbol : variable RuntimeJDOModelFactoryImpl [javac] location: class org.apache.ojb.jdori.sql.OjbFieldManager [javac] JDOModel m = RuntimeJDOModelFactoryImpl.getInstance().getJDOModel(cl); [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:292: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: class org.apache.ojb.jdori.sql.OjbFieldManager [javac] catch (JDOModelException ex
Re: Question about getIteratorByQuery
Thomas Thanks for you answer. Ok for a simple database call, but when we make this call to the persistence layer, which bring data step by step does it works ? I make a request on some table with 3 enreg numbers 1, 2 and 5 I ask some iterator at the prsistence layer. And make next. Somebody create a new enreg : the number for When I make next from the number 2. Will I get the number 4 or the number 5 ? Thanks for any help. Andre Thomas Mahler wrote: Hi Andre, To follow an index you'll need an order by clause for the indexed column. (http://db.apache.org/ojb/api/org/apache/ojb/broker/query/Criteria.html#addOrderBy(java.lang.String,%20boolean)) If you do not use an order by clause the RDBMS is not forced to serve rows in a certain sequence. cu, Thomas A Leg wrote: Hi When we use *getIteratorByQuery and .next(). * do we move throw the table following the index or in some random order ? If we go in random order, what is the best way (getting advantage of the cache) to iterate in a table following the index ? Thank's Andre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with tutorial part 4 example
Thomas Mahler dijo: > Please point me to the 1.0.1 release and I'll check if there are any > compilation problems. Yep Thomas there is a problem with the 1.01 release. It does not work with OJB. Would be fine if you check this closer. 1.01 fix many bugs from 1.0 And I am sure many people will welcome the changes. The link to 1.01 is: http://access1.sun.com/jdo/ Best Regards, Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with tutorial part 4 example
Hi again Andre, Where exactly di you get this 1.0.1 version? Our stuff was build against the 1.0 version (jdori-1_0-fcs-src-04_Mar_2002.zip): http://jcp.org/aboutJava/communityprocess/final/jsr012/index.html Please point me to the 1.0.1 release and I'll check if there are any compilation problems. cu, Thomas A Leg wrote: Hi I am learning ojb and for that, first looking tutorials and running examples. I have dowladed from Sun jdo-1_0_1-ri.zip And copy all jar under db-ojb-1.0.rc4/lib When I want to compile the JDO example I get : bin/build.sh with-jdori prepare-tutorials enhance-jdori Buildfile: build.xml splash: set-archive-name: set-archive-name-date: detect-jdk: check-jdk12proxy-classes: check-jndi-classes: use-jdk12: use-jdk13: use-jdk14: [echo] detected JDK 1.4 init: prepare: [copy] Copying 4 files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/srctest check-jdo-classes: check-jdori-classes: with-jdori: [copy] Copying 16 files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src [copy] Copying 1 file to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/tutorial5 splash: set-archive-name: set-archive-name-date: detect-jdk: check-jdk12proxy-classes: check-jndi-classes: use-jdk12: use-jdk13: use-jdk14: [echo] detected JDK 1.4 init: prepare: check-j2ee-classes: preprocess: [echo] using switches: +JDK13, +JDBC30 [java] [java] ... main: [javac] Compiling 564 source files to /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/classes [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:76: cannot resolve symbol [javac] symbol : class RuntimeJDOModelFactoryImpl [javac] location: package jdo [javac] import com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:80: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: package jdo [javac] import com.sun.jdori.model.jdo.JDOModelException; [javac]^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:64: cannot resolve symbol [javac] symbol : class RuntimeJDOModelFactoryImpl [javac] location: package jdo [javac] import com.sun.jdori.common.model.jdo.RuntimeJDOModelFactoryImpl; [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:68: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: package jdo [javac] import com.sun.jdori.model.jdo.JDOModelException; [javac]^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:252: cannot resolve symbol [javac] symbol : variable RuntimeJDOModelFactoryImpl [javac] location: class org.apache.ojb.jdori.sql.OjbStoreManager [javac] JDOModel m = RuntimeJDOModelFactoryImpl.getInstance().getJDOModel(cl); [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbStoreManager.java:255: cannot resolve symbol [javac] symbol : class JDOModelException [javac] location: class org.apache.ojb.jdori.sql.OjbStoreManager [javac] catch (JDOModelException ex) [javac]^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache/ojb/jdori/sql/OjbFieldManager.java:289: cannot resolve symbol [javac] symbol : variable RuntimeJDOModelFactoryImpl [javac] location: class org.apache.ojb.jdori.sql.OjbFieldManager [javac] JDOModel m = RuntimeJDOModelFactoryImpl.getInstance().getJDOModel(cl); [javac] ^ [javac] /home/rcs/Master/extern/java/ojb/db-ojb-1.0.rc4/target/src/org/apache
Re: Question about getIteratorByQuery
Hi Andre, To follow an index you'll need an order by clause for the indexed column. (http://db.apache.org/ojb/api/org/apache/ojb/broker/query/Criteria.html#addOrderBy(java.lang.String,%20boolean)) If you do not use an order by clause the RDBMS is not forced to serve rows in a certain sequence. cu, Thomas A Leg wrote: Hi When we use *getIteratorByQuery and .next(). * do we move throw the table following the index or in some random order ? If we go in random order, what is the best way (getting advantage of the cache) to iterate in a table following the index ? Thank's Andre - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: o.a.ojb.broker.PersistenceBrokerSQLException: Unknown Types value
Hi Thomas: Thomas Mahler dijo: > Antonio Gallardo wrote: >> I wondering why OJB does not support BOOLEAN, since it is a valid type >> for JDBC 3.0. > > No special reason. Only laziness ;-) It is an enough and good supported reason! :- Anyway, BIT works fine. I updated druid too. Best Regards, Antonio Gallardo. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]