RE: How to specify non-default DataSource for ODMG/PB api in different scenarios?
do you mean changing the used DataSource within a transaction or only how to use multiple databases? Only how to use with multiple DataSources (each with a different database login and different privelages). i.e. I've defined multiple DataSources in JBoss. Thanks, Alex -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Saturday, August 30, 2003 5:01 PM To: OJB Users List Subject: Re: How to specify non-default DataSource for ODMG/PB api in different scenarios? Hi Alex, - Original Message - From: Bates, Alex [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Friday, August 29, 2003 10:31 PM Subject: How to specify non-default DataSource for ODMG/PB api in different scenarios? Hello, I'm using the ODMG/PB APIs in the following situations; in each I need to be able to tell OJB to use a named DataSource (defined in repository_database.xml) other than the default. Any help would be appreciated - do you mean changing the used DataSource within a transaction or only how to use multiple databases? regards, Armin -- Transaction tx = odmg.currentTransaction(); tx.lock(obj, Transaction.WRITE); -- db = odmg.getDatabase(null); db.deletePersistent(obj); -- PersistenceBroker broker = ((HasBroker) odmg.currentTransaction()).getBroker(); Connection conn = null; try { conn = broker.serviceConnectionManager().getConnection(); } catch (LookupException e) { e.printStackTrace(); } -- // Must mark object as dirty to signal OJB to persist Transaction tx = odmg.currentTransaction(); ((NarrowTransaction)tx).markDirty(obj); --- Thanks! Alex - 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: object cache in ojb 1.0 rc4?
Uh, actually, from my experience, objects updated via OJB, they were NOT updated in the cache. It appears the starter of this thread had the same issue. I had to completely turn off caching to get my updates to appear on the client side... -Clay Armin Waibel wrote: Think both is ok. ObjectCacheDefaultImpl is a simple global cache which does not remove expired objects (no decay time support for objects) or does refresh periodically. But if objects were changed in OJB these changes reflected in cache. If objects outside of OJB were changed you are doomed ;-). You can easily write your own more sophisticated ObjectCache implementation. see http://db.apache.org/ojb/objectcache.html Oleg is currently refactoring the cache package, so rc5 will offer much more flexibility . regards, Armin BTW, I have set autoCommit=0 in repository_database.xml, I think autoCommit is not very good in some situations? Thanks for your any hints and help! linuxman _ MSN Explorer: http://explorer.msn.com/lccn/ - 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: How to specify non-default DataSource for ODMG/PB api in different scenarios?
Hi Alex, do you mean changing the used DataSource within a transaction or only how to use multiple databases? Only how to use with multiple DataSources (each with a different database login and different privelages). i.e. I've defined multiple DataSources in JBoss. Define for each DataSource a jdbc-connection-descriptor. PB-api: Use the defined jcdAlias name and PBKey to lookup the different DataSources PBKey user_1 = new PBKey(jcdAlias,username, passwd); PersistenceBroker broker = PersistenceBrokerFactory.createPersistenceBroker(user_1); ODMG-api: Use jcdAlias name to lookup different DataSources Implementation odmg = OJB.getInstance(); Database db = odmg.newDatabase(); db.open(jcdAlias#username#passwd, Database.OPEN_READ_WRITE); see http://db.apache.org/ojb/faq.html (or in shipped docs) sections 'How do I use multiple databases within OJB?' 'Many different database user - How do they login?' 'Needed to put user/password of database connection in repository file?' HTH regards, Armin Thanks, Alex -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Saturday, August 30, 2003 5:01 PM To: OJB Users List Subject: Re: How to specify non-default DataSource for ODMG/PB api in different scenarios? Hi Alex, - Original Message - From: Bates, Alex [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Friday, August 29, 2003 10:31 PM Subject: How to specify non-default DataSource for ODMG/PB api in different scenarios? Hello, I'm using the ODMG/PB APIs in the following situations; in each I need to be able to tell OJB to use a named DataSource (defined in repository_database.xml) other than the default. Any help would be appreciated - do you mean changing the used DataSource within a transaction or only how to use multiple databases? regards, Armin -- Transaction tx = odmg.currentTransaction(); tx.lock(obj, Transaction.WRITE); -- db = odmg.getDatabase(null); db.deletePersistent(obj); -- PersistenceBroker broker = ((HasBroker) odmg.currentTransaction()).getBroker(); Connection conn = null; try { conn = broker.serviceConnectionManager().getConnection(); } catch (LookupException e) { e.printStackTrace(); } -- // Must mark object as dirty to signal OJB to persist Transaction tx = odmg.currentTransaction(); ((NarrowTransaction)tx).markDirty(obj); --- Thanks! Alex - 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: object cache in ojb 1.0 rc4?
Hi Clay, - Original Message - From: Clay Mitchell [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Sunday, August 31, 2003 3:50 PM Subject: Re: object cache in ojb 1.0 rc4? Uh, actually, from my experience, objects updated via OJB, they were NOT updated in the cache. It appears the starter of this thread had the same issue. I had to completely turn off caching to get my updates to appear on the client side... hmm, in OJB test suite are several junit tests using object update. Can you send me a test case which reproduce your problem? Or can you modify a test case of the test suite to reproduce the problem? regards, Armin -Clay Armin Waibel wrote: Think both is ok. ObjectCacheDefaultImpl is a simple global cache which does not remove expired objects (no decay time support for objects) or does refresh periodically. But if objects were changed in OJB these changes reflected in cache. If objects outside of OJB were changed you are doomed ;-). You can easily write your own more sophisticated ObjectCache implementation. see http://db.apache.org/ojb/objectcache.html Oleg is currently refactoring the cache package, so rc5 will offer much more flexibility . regards, Armin BTW, I have set autoCommit=0 in repository_database.xml, I think autoCommit is not very good in some situations? Thanks for your any hints and help! linuxman _ MSN Explorer: http://explorer.msn.com/lccn/ - 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]
Re: HOWTO Use Anonymous Keys - bug in example src
Hah, good find, thank you! -Brian On Saturday, August 30, 2003, at 12:52 PM, Alexander Bibighaus wrote: There is a bug in the example source found in the HOWTO for Anonymous Keys In the class Finish, the method reads as follows: public void setWood(String nom) { this.wood = wood; } The setter has no effect. -alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Pbl with OQLQuery and persistent store...
I don't know what solotion that is the best one. I guess that unless the arcives have something to offer you have to try to find out by your own. Please share you findings Regards Roland - Original Message - From: Frédéric Trifiro [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Thursday, August 28, 2003 11:15 PM Subject: Re: Pbl with OQLQuery and persistent store... Hi Roland (and others) ! Oh, thank you, it has to be the good way to solve my problem !! I think about 3 solutions : 1/ specify that i don't use a cache in the ojb.properties 2/ create a new class for describing my list. Doing so, there won't be interaction between objects from the database and objects formatted for my list. 3/ remove manually objects from the cache ? Is it possible with ODMG API ? Which solution is the best ? The easiest also ? Thanks again, your help has already been very useful :) Good night ! Fred En réponse à Roland Carlsson [EMAIL PROTECTED]: Hi! You need to look at: http://db.apache.org/ojb/objectcache.html and read a little. Perhaps the text about isolation in http://db.apache.org/ojb/repository.html can get you a little bit further. Regards Roland Carlsson - Original Message - From: Frédéric Trifiro [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, August 28, 2003 6:20 PM Subject: Pbl with OQLQuery and persistent store... Hi everyone, It seems that i have a problem, a very strange behaviour of my application using OJB. I have a list that comes from the database. The first time i load it and print into the JSP, all works fine. But, when i have to reload the list, it seems that the list now comes from memory and not from the database anymore... As some columns of my list have to be formatted, the result on the screen becomes absolutely incoherent... What am i doing wrong ? I'm using ODMG API and my query is an OQLQuery... Please help... Frederic - 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] - Résonance http://www.resonance-online.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]
updating using SQL ansi udfs
To the list: If I could do a SQL update of the like: UPDATE table_name SET date_col=NOW() WHERE id=###; How should this be done under OJB? Sincerely, Jason Pyeron -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- - - - Jason Pyeron http://www.pyerotechnics.com - - Partner Sr. Manager Pyerotechnics Development, Inc. - - 500 West University Parkway #1S - - +1 (410) 808-6646 Baltimore, Maryland 21210-3253 - - - -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, purge the message from your system and notify the sender immediately. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]