[DB2]How to use both "SequenceManagerNativeImpl" and "SequenceManagerNextValImpl"
I can use "SequenceManagerNativeImpl" or "SequenceManagerNextValImpl". But, in my project, I need to use identiy column and sequence both. Because some tables use the identity itself and some tables use sequence to maintain unique no. How can I configure OJB to got it? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question Proxy
hi roland, you can also use a proxied reference. i'd prefer using proxied collections and proxied references instead of proxied classes. the worst thing you can do is mixing both concepts :( hth jakob Roland Carlsson wrote: I just wanna add that you can use a collectionProxy. Read about it in the "Advanced O/R" on the homepage of ojb. It will only use one query to materialize you collection of objects. Regards Roland Carlsson - Original Message - From: "Jakob Braeuchi" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 5:47 PM Subject: Re: Question Proxy hi joerg, well this works as designed. if the class in non proxied the select immediately materializes the fetched rows. if the class is proxied only the identities are built and wrapped by a proxy. the first time you access a method of the proxy it materializes the real object resulting in a select with primary keys. in your case the first sql is to select the primary keys (ojb always select all rows not pk only) and the other 95 are for materialization. hth jakob Joerg Lensing wrote: Hi All, I compared the p6Spy-statements of proxied and non-proxied classes. The class (userPO) is 1) dynamic proxy and 2) no proxy I queried this class directly (s.b) Query query = new QueryByCriteria(UserPO.class, null); Collection result = broker.getCollectionByQuery(query); The "dynamic proxy" produces 96 select-statements - the non-proxy only ONE! Can someone explain me this? (see zip-File for the sql.log) 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] - 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: Question Proxy
I just wanna add that you can use a collectionProxy. Read about it in the "Advanced O/R" on the homepage of ojb. It will only use one query to materialize you collection of objects. Regards Roland Carlsson - Original Message - From: "Jakob Braeuchi" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 5:47 PM Subject: Re: Question Proxy > hi joerg, > > well this works as designed. > if the class in non proxied the select immediately materializes the > fetched rows. > if the class is proxied only the identities are built and wrapped by a > proxy. the first time you access a method of the proxy it materializes > the real object resulting in a select with primary keys. > in your case the first sql is to select the primary keys (ojb always > select all rows not pk only) and the other 95 are for materialization. > > hth > jakob > > Joerg Lensing wrote: > > > Hi All, > > I compared the p6Spy-statements of proxied and non-proxied classes. > > The class (userPO) > > is 1) dynamic proxy and > >2) no proxy > > > > I queried this class directly (s.b) > >Query query = new QueryByCriteria(UserPO.class, null); > >Collection result = broker.getCollectionByQuery(query); > > > > The "dynamic proxy" produces 96 select-statements - the non-proxy only > > ONE! > > Can someone explain me this? (see zip-File for the sql.log) > > > > 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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem building repository (Posting again)
Hello: When I try to build my repository using the build-torque.xml target project-ojb-repository-classpath, I get several errors in the velocity log: 2003-09-20 11:28:04,859 - Starting Jakarta Velocity v1.3.1 2003-09-20 11:28:04,859 - RuntimeInstance initializing. 2003-09-20 11:28:04,859 - Default Properties File: org\apache\velocity\runtime\defaults\velocity.properties 2003-09-20 11:28:04,859 - Trying to use logger class org.apache.velocity.runtime.log.AvalonLogSystem 2003-09-20 11:28:04,859 - Couldn't find class org.apache.velocity.runtime.log.AvalonLogSystem or necessary supporting classes in classpath. Exception : java.lang.NoClassDefFoundError: org/apache/log/format/Formatter 2003-09-20 11:28:04,859 - Trying to use logger class org.apache.velocity.runtime.log.SimpleLog4JLogSystem 2003-09-20 11:28:04,859 - Using logger class org.apache.velocity.runtime.log.SimpleLog4JLogSystem 2003-09-20 11:28:04,869 - Default ResourceManager initializing. (class org.apache.velocity.runtime.resource.ResourceManagerImpl) 2003-09-20 11:28:04,879 - Resource Loader Instantiated: org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader 2003-09-20 11:28:04,879 - ClasspathResourceLoader : initialization starting. 2003-09-20 11:28:04,879 - ClasspathResourceLoader : initialization complete. 2003-09-20 11:28:04,889 - ResourceCache : initialized. (class org.apache.velocity.runtime.resource.ResourceCacheImpl) 2003-09-20 11:28:04,889 - Default ResourceManager initialization complete. 2003-09-20 11:28:04,889 - Loaded System Directive: org.apache.velocity.runtime.directive.Literal 2003-09-20 11:28:04,899 - Loaded System Directive: org.apache.velocity.runtime.directive.Macro 2003-09-20 11:28:04,899 - Loaded System Directive: org.apache.velocity.runtime.directive.Parse 2003-09-20 11:28:04,909 - Loaded System Directive: org.apache.velocity.runtime.directive.Include 2003-09-20 11:28:04,909 - Loaded System Directive: org.apache.velocity.runtime.directive.Foreach 2003-09-20 11:28:05,019 - Created: 20 parsers. 2003-09-20 11:28:05,019 - Velocimacro : initialization starting. 2003-09-20 11:28:05,019 - Velocimacro : adding VMs from VM library template : VM_global_library.vm 2003-09-20 11:28:05,029 - ResourceManager : unable to find resource 'VM_global_library.vm' in any resource loader. 2003-09-20 11:28:05,029 - Velocimacro : error using VM library template VM_global_library.vm : org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'VM_global_library.vm' 2003-09-20 11:28:05,029 - Velocimacro : VM library template macro registration complete. 2003-09-20 11:28:05,029 - Velocimacro : allowInline = true : VMs can be defined inline in templates 2003-09-20 11:28:05,029 - Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT replace previous VM definitions 2003-09-20 11:28:05,029 - Velocimacro : allowInlineLocal = false : VMs defined inline will be global in scope if allowed. 2003-09-20 11:28:05,029 - Velocimacro : messages on : VM system will output logging messages 2003-09-20 11:28:05,029 - Velocimacro : autoload off : VM system will not automatically reload global library macros 2003-09-20 11:28:05,029 - Velocimacro : initialization complete. 2003-09-20 11:28:05,029 - Velocity successfully started. 2003-09-20 11:28:05,430 - ResourceManager : found ojb/repository/Control.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader 2003-09-20 11:28:05,460 - ResourceManager : found ojb/repository/MainRepository.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 16,column 15] : $ojbPlatform is not a valid reference. 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 17,column 17] : ${jdbcLevel} is not a valid reference. 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 21,column 13] : $databaseDriver is not a valid reference. 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 23,column 18] : $database is not a valid reference. 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 24,column 14] : $databaseName is not a valid reference. 2003-09-20 11:28:05,460 - org.apache.velocity.runtime.exception.ReferenceException: reference : template = ojb/repository/MainRepository.vm [line 26,column 15] : $databaseUser is not a valid reference. 2003-09-20 11:28:05,520 - ResourceManager : found ojb/repository/Repository.vm with loader org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader 2003-09-20 11:28:05,540 - Left
Re: Question Proxy
hi joerg, well this works as designed. if the class in non proxied the select immediately materializes the fetched rows. if the class is proxied only the identities are built and wrapped by a proxy. the first time you access a method of the proxy it materializes the real object resulting in a select with primary keys. in your case the first sql is to select the primary keys (ojb always select all rows not pk only) and the other 95 are for materialization. hth jakob Joerg Lensing wrote: Hi All, I compared the p6Spy-statements of proxied and non-proxied classes. The class (userPO) is 1) dynamic proxy and 2) no proxy I queried this class directly (s.b) Query query = new QueryByCriteria(UserPO.class, null); Collection result = broker.getCollectionByQuery(query); The "dynamic proxy" produces 96 select-statements - the non-proxy only ONE! Can someone explain me this? (see zip-File for the sql.log) 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]
Re: storing a new object fails
If you are using a PersistenceBroker you can force an insert by using: PersitenceBroker broker = null; /* snip */ broker.store(myObject, ObjectModificationDefaultImpl.INSERT); Well thats what I do and it seems to work. Regards, Joss > try leaving the PK empty - I thnk that OJB works out whether its a insert or >update by the presence of this field > >There may be a way to force an insert but I can't remember it right now > >Jin >- Original Message - >From: "Durham David Contr 805 CSPTS/SCBE" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Friday, September 26, 2003 3:49 PM >Subject: storing a new object fails > > >I'm writing a routine that clears out a db and reloads a defined test >data set. I'm trying to insert new objects but sometimes, not always, >OJB will execute an update statement instead of an insert. I'm >explicitly setting the id pk's and bypassing the sequencemanager, so I >figure that has something to do with it, but I can't explain the >discrepancy. Can anyone point me to the likely cause of this? > >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] talk21 your FREE portable and private address on the net at http://www.talk21.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: storing a new object fails
Problem is that I need to explicitly set the id. I'm defining the test data in and the relationships in an xml file. For example: I need to know the id's so that I can assign them. Otherwise, I could try resetting the sequences, but that would make things a little more messy, programatically. I would rather bypass the sequence manager. I'm going to try the clearCache method mentioned previously, and post my results. Thanks for the suggestions, Dave >-Original Message- >From: Jin Bal [mailto:[EMAIL PROTECTED] >Sent: Friday, September 26, 2003 9:51 AM >To: OJB Users List >Subject: Re: storing a new object fails > > >try leaving the PK empty - I thnk that OJB works out whether >its a insert or update by the presence of this field > >There may be a way to force an insert but I can't remember it right now > >Jin >- Original Message - >From: "Durham David Contr 805 CSPTS/SCBE" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Friday, September 26, 2003 3:49 PM >Subject: storing a new object fails > > >I'm writing a routine that clears out a db and reloads a >defined test data set. I'm trying to insert new objects but >sometimes, not always, OJB will execute an update statement >instead of an insert. I'm explicitly setting the id pk's and >bypassing the sequencemanager, so I figure that has something >to do with it, but I can't explain the discrepancy. Can >anyone point me to the likely cause of this? > >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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: storing a new object fails
try leaving the PK empty - I thnk that OJB works out whether its a insert or update by the presence of this field There may be a way to force an insert but I can't remember it right now Jin - Original Message - From: "Durham David Contr 805 CSPTS/SCBE" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, September 26, 2003 3:49 PM Subject: storing a new object fails I'm writing a routine that clears out a db and reloads a defined test data set. I'm trying to insert new objects but sometimes, not always, OJB will execute an update statement instead of an insert. I'm explicitly setting the id pk's and bypassing the sequencemanager, so I figure that has something to do with it, but I can't explain the discrepancy. Can anyone point me to the likely cause of this? 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]
RE: storing a new object fails
Hi Dave, Actually in should to either INSERT or UPDATE if the PK is set properly, But if you inserted a row using OJB and deleted the record using JDBC And trying to store using OJB again than it wil use UPDATE, not INSERT. You should clear the cache before as it doesn't know about external operations, or don't use broker cache at all, -Sergey -Original Message- From: Durham David Contr 805 CSPTS/SCBE [mailto:[EMAIL PROTECTED] Sent: Friday, September 26, 2003 10:49 AM To: [EMAIL PROTECTED] Subject: storing a new object fails I'm writing a routine that clears out a db and reloads a defined test data set. I'm trying to insert new objects but sometimes, not always, OJB will execute an update statement instead of an insert. I'm explicitly setting the id pk's and bypassing the sequencemanager, so I figure that has something to do with it, but I can't explain the discrepancy. Can anyone point me to the likely cause of this? 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]
storing a new object fails
I'm writing a routine that clears out a db and reloads a defined test data set. I'm trying to insert new objects but sometimes, not always, OJB will execute an update statement instead of an insert. I'm explicitly setting the id pk's and bypassing the sequencemanager, so I figure that has something to do with it, but I can't explain the discrepancy. Can anyone point me to the likely cause of this? Thanks, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
caching problem ?
Folks, I have this code that doesn't work correctly. Trying to query all objects from database and receiving them always from the broker's cache. So now I am cleaning the cache every time before query. Can I do it in any other way so that I don't need to clear the whole cache every time? //-- THIS IS THE CODE public Collection findAll(Class clazz) { Collection retVal = null; PersistenceBroker broker = getBroker(); /* SHOULD UNCOMMENT IN ORDER TO WORK broker.clearCache(); */ Criteria selectAll = null; Query query = QueryFactory.newQuery(clazz, selectAll); retVal = broker.getCollectionByQuery(query); return retVal; } //-- Thank you, Sergey Manukyan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FAQ for XDoclet
Currently there is only the documentation (in the same 'contrib' directory as the module itself). However I could put together a first-steps paragraph to said documentation, although this would take a couple of days. If you have any questions, you could mail to this list or to me directly ;-) Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question Proxy
Hi All, I compared the p6Spy-statements of proxied and non-proxied classes. The class (userPO) is 1) dynamic proxy and 2) no proxy I queried this class directly (s.b) Query query = new QueryByCriteria(UserPO.class, null); Collection result = broker.getCollectionByQuery(query); The "dynamic proxy" produces 96 select-statements - the non-proxy only ONE! Can someone explain me this? (see zip-File for the sql.log) tx joerg SPYlog.zip Description: Zip compressed data - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JDO Update!
To all the people trying to work with JDO please check this document: http://access1.sun.com/jdo/ Best Regards, Antonio Gallardo - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]