RE: Clustering for OJB
Hi Vamsi, If the users are updating the same database and objects, then you will need to deal with clustering Lets say you have Machine 1 and Machine 2 1. Bob on Machine 1 retrieves object A which is stored in the cache. 2. Carol on Machine 2 retrieves Object A, and updates it 3. Bob on Machine 1 re-retrieves object, which comes from the cache. Bob will not see Carols changes. If you have two VM's updating the same objects, you need to implement some kind of cluster aware cache, which would flush Machine 1's copy of Object A when Machine 2 updates it. I know the theory - I just haven't personally implemented any cluster-aware caching yet. OJB supports pluggable caches. according to http://db.apache.org/ojb/docu/guides/objectcache.html#ObjectCacheOSCacheImpl there is a OSCache implementation - but in what OJB version it was implemented, and what JVM it is compatible with, I am not sure. I do not believe it would be difficult create wrapper around any distributed cache for OJB. Cheers, Charles -Original Message- From: Vamsi Atluri [mailto:[EMAIL PROTECTED] Sent: 17 May 2006 19:53 To: OJB Users List Subject: Clustering for OJB Hi all, I am getting some errors when I move from a non-clustered environment in our testbed to a clustered environment in QA. I have read the document about setting up OJBs in a clustered environment, however, in our cluster, there is no session sharing between various nodes in the cluster. And once a user is assigned a session on a particular server in the cluster, he always goes to the same machine till his session is terminated. So I was under the impression that I do not have to do OJB clustering. Am I correct or wrong? Also, is OSCache supported for jdk1.3.1 and OJB 1.0.1? As always, I really appreciate any help. Regards, -Vamsi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ___ HPD Software Ltd. - Helping Business Finance Business Email terms and conditions: www.hpdsoftware.com/disclaimer - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problems width performance
Hello Armin, you have written in the mailing list, that it takes around 20 sec. to store 1 objects (is 0,5 obj in 1 ms.). (http://mail-archives.apache.org/mod_mbox/db-ojb-user/200408.mbox/%3C411780E [EMAIL PROTECTED]) In my testszenario, when I logging width timestamp before calling store and also after storing, I see a difference from at least 10 ms till 50 ms for each object. Here my szenario ### # repository_language.xml # ### ## # java test code # ## broker = getBroker(); log.info("start begin transaction -> " + new Timestamp(new Date().getTime())); broker.beginTransaction(); log.info("end beginn transaction -> " + new Timestamp(new Date().getTime())); for (int i = 1; i <= 10; i++) { log.info("start store -> " + new Timestamp(new Date().getTime())); Language lang = new Language(); lang.setObjId(new Integer(i)); lang.setLang("TE_ST"); lang.setLangDesc("description"); lang.setLangCode("ENG"); lang.setActiv(new Boolean(true)); broker.store(lang); log.info("end store -> " + new Timestamp(new Date().getTime())); } log.info("start commit transaction -> " + new Timestamp(new Date().getTime())); broker.commitTransaction(); log.info("end commit transaction -> " + new Timestamp(new Date().getTime())); ## # logging output # ## Start beginn transaktion -> 2006-05-17 13:23:41.688 End beginn transaktion -> 2006-05-17 13:23:41.698 Start broker store -> 2006-05-17 13:23:41.698 Specified cache class org.apache.ojb.broker.cache.ObjectCacheEmptyImpl does not implement interface org.apache.ojb.broker.cache.ObjectCacheInternal and will be wrapped by a helper class End broker store -> 2006-05-17 13:23:41.748 Start broker store -> 2006-05-17 13:23:41.748 End broker store -> 2006-05-17 13:23:41.769 Start broker store -> 2006-05-17 13:23:41.769 End broker store -> 2006-05-17 13:23:41.799 Start broker store -> 2006-05-17 13:23:41.799 End broker store -> 2006-05-17 13:23:41.809 Start broker store -> 2006-05-17 13:23:41.809 End broker store -> 2006-05-17 13:23:41.819 Start broker store -> 2006-05-17 13:23:41.829 End broker store -> 2006-05-17 13:23:41.839 Start broker store -> 2006-05-17 13:23:41.839 End broker store -> 2006-05-17 13:23:41.869 Start broker store -> 2006-05-17 13:23:41.869 End broker store -> 2006-05-17 13:23:41.879 Start broker store -> 2006-05-17 13:23:41.899 Start creating new ObjectCache instance Instantiate new org.apache.ojb.broker.cache.CacheDistributor for PB instance [EMAIL PROTECTED] New ObjectCache instance was created Specified cache class org.apache.ojb.broker.cache.ObjectCacheEmptyImpl does not implement interface org.apache.ojb.broker.cache.ObjectCacheInternal and will be wrapped by a helper class End broker store -> 2006-05-17 13:23:42.019 Start commit transaktion -> 2006-05-17 13:23:42.039 End commit transaktion -> 2006-05-17 13:23:42.039 I have no idee, why my application takes 20 ms per object to store :o( I also wondering, that OJB stores bevor committing the transaction. I Developing an Eclipse RCP width hsqldb and postgres and OJB 1.0.3 Thanks a lot for your help! Josef Wagner - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Clustering for OJB
Hi all, I am getting some errors when I move from a non-clustered environment in our testbed to a clustered environment in QA. I have read the document about setting up OJBs in a clustered environment, however, in our cluster, there is no session sharing between various nodes in the cluster. And once a user is assigned a session on a particular server in the cluster, he always goes to the same machine till his session is terminated. So I was under the impression that I do not have to do OJB clustering. Am I correct or wrong? Also, is OSCache supported for jdk1.3.1 and OJB 1.0.1? As always, I really appreciate any help. Regards, -Vamsi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error in beginTransaction!
I have used the Liferay Portal before. Here is a thought. I thought about trying this myself but never got around to it. Liferay portal creates a datasource is liferay.xml. In Tomcat this is /%LIFERAY_HOME/conf/Catalina/localhost/liferay.xml Why not have OJB use existing datasource for transactions? http://db.apache.org/ojb/docu/guides/deployment.html#Configure+OJB+for+manag ed+environments+considering+as+JBoss+example Regard, Eric ->-Original Message- ->From: Marcel Souza [mailto:[EMAIL PROTECTED] ->Sent: Wednesday, May 17, 2006 12:21 PM ->To: OJB Users List ->Subject: Re: Error in beginTransaction! -> ->Hello Armin, -> ->I am posting the whole trace. ->One strange fact: my application works perfectly fine using ->Oracle but shows the error (Can't lookup a connection) using Mysql. ->I did the replacements in code you sugested, unfortunatelly ->it keeps showing the same error message. :( Thanks for your help, -> ->marcel. -> ->14:06:56,203 INFO [Server] JBoss (MX MicroKernel) [3.2.5 (build: ->CVSTag=JBoss_3 ->_2_5 date=200406251954)] Started in 1m:282ms ->14:06:56,203 INFO [Tomcat5] Saw ->org.jboss.system.server.started notification, s tarting ->connectors 14:06:56,250 INFO [Http11Protocol] Starting ->Coyote HTTP/1.1 on ->http-0.0.0.0-808 ->0 ->14:06:56,500 INFO [ChannelSocket] JK2: ajp13 listening on ->/0.0.0.0:8009 ->14:06:56,515 INFO [JkMain] Jk running ID=0 time=0/109 config=null ->14:07:14,093 INFO [STDOUT] [BOOT] ERROR: ->14:07:14,093 INFO [STDOUT] The specified class ->"org.apache.ojb.broker.locking.L ockManagerInMemoryImpl" does ->not implement the interface org.apache.ojb.odmg.loc ->king.LockManager, which is a requirement for the key ->"LockManagerClass". ->Using d ->efault class class org.apache.ojb.odmg.locking.LockManagerDefaultImpl ->14:07:14,234 INFO [PersistenceBrokerFactoryDefaultImpl] ->Create PersistenceBroke r instance pool, pool configuration ->was {whenExhaustedAction=0, maxIdle=-1, maxA ctive=100, ->maxWait=2000, removeAbandoned=false, ->numTestsPerEvictionRun=10, testW hileIdle=false, ->minEvictableIdleTimeMillis=100, testOnReturn=false, ->logAband oned=false, removeAbandonedTimeout=300, ->timeBetweenEvictionRunsMillis=-1, testOn Borrow=false} ->14:07:14,250 INFO [RepositoryPersistor] OJB Descriptor Repository: ->file:/C:/jbo ->ss-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/re ->pository.xml ->14:07:14,250 INFO [RepositoryPersistor] Building repository ->from :file:/C:/jbos ->s-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/rep ->ository.xml ->14:07:14,562 INFO [RepositoryPersistor] Read class ->descriptors took 312 ms ->14:07:14,562 INFO [RepositoryPersistor] OJB Descriptor Repository: ->file:/C:/jbo ->ss-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/re ->pository.xml ->14:07:14,578 INFO [RepositoryPersistor] Building repository ->from :file:/C:/jbos ->s-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/rep ->ository.xml ->14:07:14,609 INFO [RepositoryPersistor] Read connection ->repository took 47 ms ->14:07:14,703 INFO [ObjectCacheFactory] Start creating new ->ObjectCache instance ->14:07:14,703 INFO [ObjectCacheFactory] Default ObjectCache ->class was org.apache .ojb.broker.cache.ObjectCacheDefaultImpl ->14:07:14,703 INFO [CacheDistributor] Use property ->'descriptorBasedCaches' ->is se ->t 'false' ->14:07:14,703 INFO [ObjectCacheFactory] Instantiate new ->org.apache.ojb.broker.ca che.CacheDistributor class object ->14:07:14,734 INFO [ObjectCacheFactory] New ObjectCache ->instance was created ->14:07:14,796 INFO [ConnectionFactoryPooledImpl] Create new ->connection pool:org. ->[EMAIL PROTECTED] -> jcd-alias=default -> default-connection=true -> dbms=Oracle -> jdbc-level=2.0 -> driver=oracle.jdbc.driver.OracleDriver -> protocol=jdbc -> sub-protocol=oracle -> db-alias=thin:@192.168.0.5:1521:dbserver -> user=tlportal -> password=* -> eager-release=false -> ConnectionPoolDescriptor={whenExhaustedAction=2, ->maxIdle=50, maxActive=100, ma xWait=5000, ->removeAbandoned=false, numTestsPerEvictionRun=10, ->testWhileIdle=fals e, minEvictableIdleTimeMillis=60, ->testOnReturn=false, logAbandoned=false, re ->moveAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, ->testOnBorrow=true} -> batchMode=false -> useAutoCommit=AUTO_COMMIT_IGNORE_STATE -> ignoreAutoCommitExceptions=false -> ->sequenceDescriptor=org.apache.ojb.broker.metadata.SequenceDesc ->[EMAIL PROTECTED] -> sequenceManagerClass=class ->org.apache.ojb.broker.util.sequence.SequenceMana ->gerNextValImpl -> Properties={autoNaming=false} ->] ->] ->14:07:15,781 INFO [ObjectCacheFactory] Start creating new ->ObjectCache instance ->14:07:15,781 INFO [ObjectCacheFactory] Default ObjectCache ->class was org.apache .ojb.broker.cache.ObjectCacheDefaultImpl ->14:07:15,781 INFO [CacheDistributor] Use property ->'descriptorBasedCaches' ->is se ->t 'false' ->14:07:15,781 INFO [Object
Re: Error in beginTransaction!
Hello Armin, I am posting the whole trace. One strange fact: my application works perfectly fine using Oracle but shows the error (Can't lookup a connection) using Mysql. I did the replacements in code you sugested, unfortunatelly it keeps showing the same error message. :( Thanks for your help, marcel. 14:06:56,203 INFO [Server] JBoss (MX MicroKernel) [3.2.5 (build: CVSTag=JBoss_3 _2_5 date=200406251954)] Started in 1m:282ms 14:06:56,203 INFO [Tomcat5] Saw org.jboss.system.server.started notification, s tarting connectors 14:06:56,250 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-0.0.0.0-808 0 14:06:56,500 INFO [ChannelSocket] JK2: ajp13 listening on /0.0.0.0:8009 14:06:56,515 INFO [JkMain] Jk running ID=0 time=0/109 config=null 14:07:14,093 INFO [STDOUT] [BOOT] ERROR: 14:07:14,093 INFO [STDOUT] The specified class "org.apache.ojb.broker.locking.L ockManagerInMemoryImpl" does not implement the interface org.apache.ojb.odmg.loc king.LockManager, which is a requirement for the key "LockManagerClass". Using d efault class class org.apache.ojb.odmg.locking.LockManagerDefaultImpl 14:07:14,234 INFO [PersistenceBrokerFactoryDefaultImpl] Create PersistenceBroke r instance pool, pool configuration was {whenExhaustedAction=0, maxIdle=-1, maxA ctive=100, maxWait=2000, removeAbandoned=false, numTestsPerEvictionRun=10, testW hileIdle=false, minEvictableIdleTimeMillis=100, testOnReturn=false, logAband oned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOn Borrow=false} 14:07:14,250 INFO [RepositoryPersistor] OJB Descriptor Repository: file:/C:/jbo ss-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/repository.xml 14:07:14,250 INFO [RepositoryPersistor] Building repository from :file:/C:/jbos s-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/repository.xml 14:07:14,562 INFO [RepositoryPersistor] Read class descriptors took 312 ms 14:07:14,562 INFO [RepositoryPersistor] OJB Descriptor Repository: file:/C:/jbo ss-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/repository.xml 14:07:14,578 INFO [RepositoryPersistor] Building repository from :file:/C:/jbos s-3.2.5/server/default/deploy/9audaces.war/WEB-INF/classes/repository.xml 14:07:14,609 INFO [RepositoryPersistor] Read connection repository took 47 ms 14:07:14,703 INFO [ObjectCacheFactory] Start creating new ObjectCache instance 14:07:14,703 INFO [ObjectCacheFactory] Default ObjectCache class was org.apache .ojb.broker.cache.ObjectCacheDefaultImpl 14:07:14,703 INFO [CacheDistributor] Use property 'descriptorBasedCaches' is se t 'false' 14:07:14,703 INFO [ObjectCacheFactory] Instantiate new org.apache.ojb.broker.ca che.CacheDistributor class object 14:07:14,734 INFO [ObjectCacheFactory] New ObjectCache instance was created 14:07:14,796 INFO [ConnectionFactoryPooledImpl] Create new connection pool:org. [EMAIL PROTECTED] jcd-alias=default default-connection=true dbms=Oracle jdbc-level=2.0 driver=oracle.jdbc.driver.OracleDriver protocol=jdbc sub-protocol=oracle db-alias=thin:@192.168.0.5:1521:dbserver user=tlportal password=* eager-release=false ConnectionPoolDescriptor={whenExhaustedAction=2, maxIdle=50, maxActive=100, ma xWait=5000, removeAbandoned=false, numTestsPerEvictionRun=10, testWhileIdle=fals e, minEvictableIdleTimeMillis=60, testOnReturn=false, logAbandoned=false, re moveAbandonedTimeout=300, timeBetweenEvictionRunsMillis=-1, testOnBorrow=true} batchMode=false useAutoCommit=AUTO_COMMIT_IGNORE_STATE ignoreAutoCommitExceptions=false [EMAIL PROTECTED] sequenceManagerClass=class org.apache.ojb.broker.util.sequence.SequenceMana gerNextValImpl Properties={autoNaming=false} ] ] 14:07:15,781 INFO [ObjectCacheFactory] Start creating new ObjectCache instance 14:07:15,781 INFO [ObjectCacheFactory] Default ObjectCache class was org.apache .ojb.broker.cache.ObjectCacheDefaultImpl 14:07:15,781 INFO [CacheDistributor] Use property 'descriptorBasedCaches' is se t 'false' 14:07:15,781 INFO [ObjectCacheFactory] Instantiate new org.apache.ojb.broker.ca che.CacheDistributor class object 14:07:15,781 INFO [ObjectCacheFactory] New ObjectCache instance was created 14:07:15,781 INFO [ConnectionFactoryPooledImpl] Create new connection pool:org. [EMAIL PROTECTED] jcd-alias=mysql default-connection=false dbms=MySQL jdbc-level=3.0 driver=com.mysql.jdbc.Driver protocol=jdbc sub-protocol=mysql db-alias=//localhost:3306/lportal user=root password=* eager-release=false ConnectionPoolDescriptor={whenExhaustedAction=2, validationQuery=SELECT 1, max Idle=2, maxActive=30, maxWait=5000, removeAbandoned=false, numTestsPerEvictionRu n=10, testWhileIdle=false, minEvictableIdleTimeMillis=60, testOnReturn=false , logAbandoned=false, removeAbandonedTimeout=300, timeBetweenEvictionRunsMillis= -1, testOnBorrow=true} batchMode=false useAutoCommit=AUTO_COMMIT_IGNORE_STATE ignoreAutoCommitExceptions=false
Re: generate global uid's
Sorry, nope! At the beginning of OJB some people plan to support beside RDBMS and other persistence datastores, but it was too complex to realize with a few OJB committer. Thanks for clearing out, where exactly lies the complexity, the quering i solved my own project. I have the biggest problem with activationdepth, with OJB there isn't such concept (aka lazy loading). Dunno of that is db4objects specific or also SODA. With how many are you working currently on OJB? Cheers, Dennis
Re: updating the primary key of a table row
Hi Armin, For this special case you have to delete the old value/obj and then insert the new vale/obj. regards, Armin thanks a lot. I thought of this possibility, but wondered if there is another way to perform the update. Regards, Abid -- Abid Hussain Mail: [EMAIL PROTECTED] Web: http://www.abid76.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]