Proxy in Reference
Hi, I have object A, which have reference to object B - attribute aToB. This reference is proxy=true. I set attribute aToB in object A to proxy of object B. After broker.store (I use store(Object a, ObjectModification om), in database I found that object A don't have any reference to object B (foreign key=null). Should I materialize proxy of B in object A before store ? If I use ProxyHelper.getRealObject, all references in database are set properly. Thanks in advance. Best regards Tadeus Garsva - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JBoss 3.0 and eager-release
Hi Julia, this flag was introduced to make OJB working within JBoss in ejb based environment (e.g. session beans) - notice, only when using OJB within ejb's. Thus the section is called 'Deployment in EJB based applications'. It's a workaround till we will find a better solution. Sorry for the hassle I will add additional information in this section. regards, Armin - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, July 11, 2003 10:17 AM Subject: JBoss 3.0 and eager-release Hello! I just wanted to tell that something in the documentation doesn't seem to be right. The documentation says when using JBoss 3.0 (as I do with 3.0.6) you should set eager-realease=true in the jdbc-connection-descriptor. This cost my like a week, because with this flag being set I wasn't able to insert or delete objects! OJB didn't even generate a SQL statement! Now after setting this flag to false everything works great! Can you anybody explain that? What was this flag intended for? Julia. - 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]
Help Request - java.lang.ExceptionInInitializerError
Help! I have know idea what is going on here. When I deploy to my Tomcat environment I get this message. If I remove Calcuations from Repository everything works. I have verified that the Jar file does indeed have the Calculations attribute in Product and the Calculations objects. See stack and repository below. Thoughts? java.lang.ExceptionInInitializerError at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.buildDefa ultKey(Unknown Source) at org.apache.ojb.broker.core.PersistenceBrokerFactoryDefaultImpl.(Unknown Source) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA ccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at java.lang.Class.newInstance0(Class.java:306) at java.lang.Class.newInstance(Class.java:259) 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.getConfigurator(Unknown Source) at org.apache.ojb.odmg.OJB.getInstance(Unknown Source) at gsfsew.services.GsfsewServiceOJBImpl.(GsfsewServiceOJBImpl.java:73) Caused by: org.apache.ojb.broker.metadata.MetadataException: Could not read repository class descriptor data, using repository: repository.xml: Error creating PersistentField: sd.prodAgr.Product, calculations at org.apache.ojb.broker.metadata.MetadataManager.init(Unknown Source) at org.apache.ojb.broker.metadata.MetadataManager.(Unknown Source) at org.apache.ojb.broker.metadata.MetadataManager.(Unknown Source) ... 57 more Caused by: org.apache.ojb.broker.metadata.MetadataException: Error creating PersistentField: sd.prodAgr.Product, calculations at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldFactory.create PersistentField(Unknown Source) at org.apache.ojb.broker.metadata.AttributeDescriptorBase.setPersistentFiel d(Unknown Source) at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXPars er.java:459) at org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinde r.java:572) at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator. java:727) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X MLDocumentFragmentScannerImpl.java:759) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo cumentFragmentScannerImpl.java:329) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 25) at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 81) at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java :1175) at org.apache.ojb.broker.metadata.RepositoryPersistor.readMetadataFromXML(U nknown Source) at org.apache.ojb.broker.metadata.RepositoryPersistor.buildRepository(Unkno wn Source) at org.apache.ojb.broker.metadata.RepositoryPersistor.readDescriptorReposit ory(Unknown Source) ... 60 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedConstructorAccessor90.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons tructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source) ... 76 more Caused by: org.apache.ojb.broker.metadata.MetadataException: Can't find member calculations in sd.prodAgr.Product: calculations at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.co mputeField(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.(U nknown Source) ... 80 more Caused by: java.lang.NoSuchFieldException: calculations at java.lang.Class.getField0(Class.java:1735) at java.lang.Class.getDeclaredField(Class.java:1189) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDefaultImpl.ge tFieldRecursive(Unknown Source) at
XDoclet module update
Hi, I think there was no mention of it yet so I just wanted to post that a new version of the XDoclet OJB module is in the CVS. Here a quick summary of the new stuff/changes: New features: * Support for anonymous fields and references (the tags ojb.field and ojb.reference now can be put into the class javadoc comment). * Support for indices (new tag ojb.index). The unique attribute of the ojb.field is therefore no longer supported. * Support for query customizers (new tag ojb.query-customizer). * Support for all attributes of class, field, reference, and collection descriptors (as of OJB CVS version Juli 4th 2003). Changed features: * ojb.documentation and ojb.attribute are no longer supported. Rather, the documentation and/or attributes are now put into the new documentation/attributes attributes of relevant tags. This also allows to override them in subclasses. * Updated documentation (including a m:n collection example). Other: * The four bugs reported to the ojb-user mailing list are fixed. * Fixed a bug where the order of generated xml tags in the repository-descriptor was not in accordance with the dtd. Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Potential problem with prefetch-relationships ?
hi theo, during prefetch auto-retrieve is disabled. when an other thread uses the relationship-desriptor it will find auto-retrive off. this is a known problem but i do not have a solution for it :( jakob Theo Niemeijer wrote: Hi all, I seemed to have stumbled on a potential problem with the prefetch relationship option in PB query. After using prefetchRelationship for retrieval of big list of results, and at the same time performing other queries, I seemed to have lost the auto-retrieve attribute on the collection descriptor. The result was that subsequent queries did not retrieve that collection anymore, probably because the auto-retrieve was disabled. The problem is quite hard to reproduce, but my guess is that different threads modified the repository descriptor in the wrong sequence, by means of the setCascadeRetrieve method used in prepareRelationshipSettings. I might be wrong, because I simply do not oversee all aspects of OJB. But am I right to view this as a potential problem in concurrency situations like websites ? I do not feel too comfortable that OJB makes these temporary changes to the repository model. Cheers, Theo Niemeijer - 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: Proxy in Reference
yes! Tadeus Garsva wrote: Thanks for so fast reply. So, if I want all foreign keys to be set properly, I have to materialize all references in a object before store.Is it true? Best regards Tadeus Garsva Mahler Thomas wrote: Hi, If a proxy is not materialized, OJB does not store the real object. The idea behind this is that if a proxy is not loaded, the object behind the proxy was not changed by user code. cheers, Thomas -Original Message- From: Tadeus Garsva [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 10:15 AM To: OJB Users List Subject: Proxy in Reference Hi, I have object A, which have reference to object B - attribute aToB. This reference is proxy=true. I set attribute aToB in object A to proxy of object B. After broker.store (I use store(Object a, ObjectModification om), in database I found that object A don't have any reference to object B (foreign key=null). Should I materialize proxy of B in object A before store ? If I use ProxyHelper.getRealObject, all references in database are set properly. Thanks in advance. Best regards Tadeus Garsva - 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]
patch for optimistic locking bug?
I recall there was a bug with updates and optimistic locking, and a patch was submitted. How would I go about getting that patch? I seem to be running smack into the bug. I took a look at the CVS stuff, but I am not really sure how to navigate it. thanks, Bonnie MacKellar software engineer Mobius Management Systems, Inc. [EMAIL PROTECTED]
RE: Nested Queries
Hi Jakob, I set up a test case with the following model: [A] -1--n- [B] -1--1- [C] -1--1- [D] | | | | [A1] [A2][C1] [C2] All queries are run against the A base class. If I map only the A extent, OJB executes two sql queries as expected, one for the A1 extent and one for the A2 extent. So I then mapped the C extent hierarchy with B having a reference descriptor referencing the C base class. This generated the following incorrect SQL. SELECT A0.FIELD, A0.AID FROM tblA1 A0 INNER JOIN tblB A1 ON A0.AID=A1.AID LEFT OUTER JOIN null A2 ON A1.CID=A2.CID LEFT OUTER JOIN tblC2 A2E1 ON A1.CID=A2E1.CID LEFT OUTER JOIN tblC1 A2E0 ON A1.CID=A2E0.CID WHERE (field = 'one' OR A2E1.FIELD = 'one' OR A2E0.FIELD = 'one' ) However, if I map the B object to reference the C1 object instead of the C base class, the sql generated is as expected. So I've determined that the problem occurs when an extent with an abstract base class or interface is specified in the reference descriptor. If I make the base class concrete, the sql is generated correctly. Wallace J Gelhar Facilities Planning Management Computer Information Systems [EMAIL PROTECTED] (715) 836-3411 -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 1:32 PM To: OJB Users List Subject: Re: Nested Queries hi wallace, i do not have exactly your model, but i can query for persons using criteria from payments: [Person] -1--n- [accounts] -1--n- [payments] the following sample asks for persons having an account with payments 500: crit = new Criteria(); crit.addGreaterThan(konti.bewegungen.betrag, new BigDecimal(500)); query = new QueryByCriteria(Person.class, crit, true); // DISTINCT SELECT DISTINCT A0.isBoss,A0.gebDat,A0.idTest,A0.entryDate,A0.adresse,A0.idPartner,A0.na me,A0.test,A0.vorname,A0.id FROM tabPerson A0 INNER JOIN tabKonto A1 ON A0.id=A1.idPerson INNER JOIN tabBewegung A2 ON A1.id=A2.idKonto WHERE A2.betrag '500' i do not expect the proxies to be a problem, they do not affect sql building. but the exents may be a problem. you said it worked without any extents. does is also work with extents either on A or B ? do you probably have a testcase including sql-skripts, classes and repository ? jakob Gelhar, Wallace Joseph wrote: Hi Jakob, Are there any known issues with extents and nested queries? My actual object model is as follows (somewhat simplified): [A] -1--n- [B] -1--1- [C] -1--1- [D] | | | | [A1] [A2][B1] [B2] -All references and collections are proxied. -All classes are referenced through their respective interface The strange part is 1. I can query for C objects using a D field as criteria 2. I can query for B (or B1) objects using a C field as criteria 3. I can query for A objects using a B field as criteria 4. I cannot query for A objects using C or D fields as criteria I've made a simplified test case without interfaces, proxies or extents and the query works as you described. I'm still digging to try and break it in a controlled manner. Any thoughts? Wallace J Gelhar Facilities Planning Management Computer Information Systems [EMAIL PROTECTED] (715) 836-3411 -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 10:47 AM To: OJB Users List Subject: Re: Nested Queries hi wallace, nested queries are supported: [Konto] -1--1- [Person] -1--n- [Telefon] the following queries all accounts (konto) with a balance 100 belonging to a person with a phonenumber like 031% crit = new Criteria(); crit.addGreaterThan(saldo, new BigDecimal(100)); crit.addLike(inhaber.telefone.nummer, 031%); query = new QueryByCriteria(Konto.class, crit, true); // DISTINCT SELECT DISTINCT A0.idPerson,A0.saldo,A0.nummer,A0.id FROM tabKonto A0 INNER JOIN tabPerson A1 ON A0.idPerson=A1.id INNER JOIN tabTelefon A2 ON A1.id=A2.idPerson WHERE (A0.saldo '100' ) AND A2.tel_nr LIKE '031%' hth jakob Gelhar, Wallace Joseph wrote: I am trying to execute a multiple nested PB query against an object model such as follows: [A] -1--n- [B] -1--1- [C] -1--1- [D] Criteria criteria = new Criteria(); criteria.addEqualTo(bCollection.c.d.value, constant); Query query = new QueryByCriteria(A.class, criteria); Collection aCollection = Broker.getCollectionByQuery(query); ... This should produce the SQL such as SELECT A.field FROM A A0 INNER JOIN B A1 ON A0.fk = A1.pk INNER JOIN C A2 ON A1.fk = A2.pk INNER JOIN D A3 ON A2.fk = A3.pk WHERE A3.value = 'constant' But instead it produces only a single join SELECT A.field FROM A A0 INNER JOIN B A1 ON A0.fk = A1.pk WHERE value = 'constant' My question is if this type of multiple nested queries is supported? Or is only a single level of nesting supported? How
Re: Nested Queries
hi wallace, i can confirm that the extent in the ref-desriptor is a problem: [Person] -1--n- [accounts] -1--n- [payments][account] has extents [account1] produces the following sql: SELECT DISTINCT A0.isBoss,A0.gebDat,A0.idTest,A0.entryDate,A0.adresse,A0.idPartner,A0.name,A0.test,A0.vorname,A0.id FROM tabPerson A0 LEFT OUTER JOIN tabKonto A1 ON A0.id=A1.idPerson LEFT OUTER JOIN tabBewegung A2 ON A1.id=A2.idKonto LEFT OUTER JOIN tabKonto1 A1E0 ON A0.id=A1E0.idPerson WHERE A2.betrag '500' instead of something like this: SELECT DISTINCT A0.isBoss,A0.gebDat,A0.idTest,A0.entryDate,A0.adresse,A0.idPartner,A0.name,A0.test,A0.vorname,A0.id FROM tabPerson A0 LEFT OUTER JOIN tabKonto A1 ON A0.id=A1.idPerson LEFT OUTER JOIN tabBewegung A2 ON A1.id=A2.idKonto LEFT OUTER JOIN tabKonto1 A1E0 ON A0.id=A1E0.idPerson LEFT OUTER JOIN tabBewegung A3 ON A1E0.id=A3.idKonto WHERE A2.betrag '500' or A3.betrag '500' the relationship from account to payment (tabKonto, tabBewegung) is only resolved for the concrete class not the extent. jakob Gelhar, Wallace Joseph wrote: Hi Jakob, I set up a test case with the following model: [A] -1--n- [B] -1--1- [C] -1--1- [D] | | | | [A1] [A2][C1] [C2] All queries are run against the A base class. If I map only the A extent, OJB executes two sql queries as expected, one for the A1 extent and one for the A2 extent. So I then mapped the C extent hierarchy with B having a reference descriptor referencing the C base class. This generated the following incorrect SQL. SELECT A0.FIELD, A0.AID FROM tblA1 A0 INNER JOIN tblB A1 ON A0.AID=A1.AID LEFT OUTER JOIN null A2 ON A1.CID=A2.CID LEFT OUTER JOIN tblC2 A2E1 ON A1.CID=A2E1.CID LEFT OUTER JOIN tblC1 A2E0 ON A1.CID=A2E0.CID WHERE (field = 'one' OR A2E1.FIELD = 'one' OR A2E0.FIELD = 'one' ) However, if I map the B object to reference the C1 object instead of the C base class, the sql generated is as expected. So I've determined that the problem occurs when an extent with an abstract base class or interface is specified in the reference descriptor. If I make the base class concrete, the sql is generated correctly. Wallace J Gelhar Facilities Planning Management Computer Information Systems [EMAIL PROTECTED] (715) 836-3411 -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Friday, July 11, 2003 1:32 PM To: OJB Users List Subject: Re: Nested Queries hi wallace, i do not have exactly your model, but i can query for persons using criteria from payments: [Person] -1--n- [accounts] -1--n- [payments] the following sample asks for persons having an account with payments 500: crit = new Criteria(); crit.addGreaterThan(konti.bewegungen.betrag, new BigDecimal(500)); query = new QueryByCriteria(Person.class, crit, true); // DISTINCT SELECT DISTINCT A0.isBoss,A0.gebDat,A0.idTest,A0.entryDate,A0.adresse,A0.idPartner,A0.na me,A0.test,A0.vorname,A0.id FROM tabPerson A0 INNER JOIN tabKonto A1 ON A0.id=A1.idPerson INNER JOIN tabBewegung A2 ON A1.id=A2.idKonto WHERE A2.betrag '500' i do not expect the proxies to be a problem, they do not affect sql building. but the exents may be a problem. you said it worked without any extents. does is also work with extents either on A or B ? do you probably have a testcase including sql-skripts, classes and repository ? jakob Gelhar, Wallace Joseph wrote: Hi Jakob, Are there any known issues with extents and nested queries? My actual object model is as follows (somewhat simplified): [A] -1--n- [B] -1--1- [C] -1--1- [D] | | | | [A1] [A2][B1] [B2] -All references and collections are proxied. -All classes are referenced through their respective interface The strange part is 1. I can query for C objects using a D field as criteria 2. I can query for B (or B1) objects using a C field as criteria 3. I can query for A objects using a B field as criteria 4. I cannot query for A objects using C or D fields as criteria I've made a simplified test case without interfaces, proxies or extents and the query works as you described. I'm still digging to try and break it in a controlled manner. Any thoughts? Wallace J Gelhar Facilities Planning Management Computer Information Systems [EMAIL PROTECTED] (715) 836-3411 -Original Message- From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 09, 2003 10:47 AM To: OJB Users List Subject: Re: Nested Queries hi wallace, nested queries are supported: [Konto] -1--1- [Person] -1--n- [Telefon] the following queries all accounts (konto) with a balance 100 belonging to a person with a phonenumber like 031% crit = new Criteria(); crit.addGreaterThan(saldo, new BigDecimal(100)); crit.addLike(inhaber.telefone.nummer, 031%); query = new QueryByCriteria(Konto.class, crit, true); // DISTINCT SELECT DISTINCT
Re: Performance Test Results
Thanks Thomas, I've stopped running out of connection pools... I'm above the threshold now. What is the reason for having both a properties and XML configuration file? I think it would be more convenient to have a globals section in the repository.xml. Just my opinion. Thanks again, Aaron Thomas Mahler wrote: Hi Aaron, OJB uses several Pools. One pool is used for Broker instances. Then there is another pool for JDBC connections. What you see is a shortage of JDBC connections. The Broker pool is configured in OJB.properties, as it is a global setting. The Connection Pool is configured in repository.xml, as it can be configured per JDBC connection. connection-pool maxActive=100 whenExhaustedAction=2 / Allows 100 parallel connnections. If all connections are exhausted the pool grows (=2). all features are documented here: http://db.apache.org/ojb/repository.html#connection-pool cheers, Thomas Aaron Longwell wrote: I have decided to load test an OJB+Struts web application I am building. The results, pass! (but not by a whole lot). My goal was to support 100 simultaneous users. The application is an event scheduler, for which one view is a calendar-formatted display of events for the month. It uses OJBs getCollectionByQuery (PB API) to retrieve the events. Using Apache's JMeter, I simulated 100 users loading the calendar page about every 15 seconds. This comes out to around 6-8 requests per second. Average response times are under 1 second on my very modest machine. I received no errors after running at this load for several minutes... in short.. a successful test. However, upping the users to 150 begins destroying the error percentage. Every error that occured was a commons-logging unable to borrow connection from pool exception (see afterword for StackTrace). Can someone explain the performance enhancement features of OJB to me? I have perused the OJB.properties and found maxActive=100 as the default for the number of brokers. I have changed this to 600 with no result. In my stack trace I see that there is a connectionPoolDescriptor setting of maxActive=21 (see below). Is it possible to change this value in the properties file? What is the name for the name value pair if so? Are there other enhancements I can make to support more users? Thanks, Aaron Longwell Selected Portions of Stack Trace: Used ConnectionManager instance could not obtain a connection: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED] jcd-alias=dovedb default-connection=true dbms=MySQL jdbc-level=2.0 driver=com.mysql.jdbc.Driver protocol=jdbc sub-protocol=mysql db-alias=//localhost/dove eager-release=false ConnectionPoolDescriptor={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=true} - 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: Performance Test Results
Jason, I am running in Tomcat by itself. I haven't hit any broker instance errors, just connection pool ones but this is solved after changing the maxActive setting. Aaron Jason McKerr wrote: You broker instances would still be limited by your connection pool I think. Are you in a standalone or application server environment? Jason On Thu, 2003-07-10 at 22:27, Aaron Longwell wrote: I have decided to load test an OJB+Struts web application I am building. The results, pass! (but not by a whole lot). My goal was to support 100 simultaneous users. The application is an event scheduler, for which one view is a calendar-formatted display of events for the month. It uses OJBs getCollectionByQuery (PB API) to retrieve the events. Using Apache's JMeter, I simulated 100 users loading the calendar page about every 15 seconds. This comes out to around 6-8 requests per second. Average response times are under 1 second on my very modest machine. I received no errors after running at this load for several minutes... in short.. a successful test. However, upping the users to 150 begins destroying the error percentage. Every error that occured was a commons-logging unable to borrow connection from pool exception (see afterword for StackTrace). Can someone explain the performance enhancement features of OJB to me? I have perused the OJB.properties and found maxActive=100 as the default for the number of brokers. I have changed this to 600 with no result. In my stack trace I see that there is a connectionPoolDescriptor setting of maxActive=21 (see below). Is it possible to change this value in the properties file? What is the name for the name value pair if so? Are there other enhancements I can make to support more users? Thanks, Aaron Longwell Selected Portions of Stack Trace: Used ConnectionManager instance could not obtain a connection: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED] jcd-alias=dovedb default-connection=true dbms=MySQL jdbc-level=2.0 driver=com.mysql.jdbc.Driver protocol=jdbc sub-protocol=mysql db-alias=//localhost/dove eager-release=false ConnectionPoolDescriptor={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=true} - 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: Performance Test Results
If you're using an app-server that has a built in connection pool, you need to make sure that the connection pool is sufficient. OJB will be limited in the connections it can use from the app-server. Jason On Fri, 2003-07-11 at 13:43, Aaron Longwell wrote: Jason, I am running in Tomcat by itself. I haven't hit any broker instance errors, just connection pool ones but this is solved after changing the maxActive setting. Aaron Jason McKerr wrote: You broker instances would still be limited by your connection pool I think. Are you in a standalone or application server environment? Jason On Thu, 2003-07-10 at 22:27, Aaron Longwell wrote: I have decided to load test an OJB+Struts web application I am building. The results, pass! (but not by a whole lot). My goal was to support 100 simultaneous users. The application is an event scheduler, for which one view is a calendar-formatted display of events for the month. It uses OJBs getCollectionByQuery (PB API) to retrieve the events. Using Apache's JMeter, I simulated 100 users loading the calendar page about every 15 seconds. This comes out to around 6-8 requests per second. Average response times are under 1 second on my very modest machine. I received no errors after running at this load for several minutes... in short.. a successful test. However, upping the users to 150 begins destroying the error percentage. Every error that occured was a commons-logging unable to borrow connection from pool exception (see afterword for StackTrace). Can someone explain the performance enhancement features of OJB to me? I have perused the OJB.properties and found maxActive=100 as the default for the number of brokers. I have changed this to 600 with no result. In my stack trace I see that there is a connectionPoolDescriptor setting of maxActive=21 (see below). Is it possible to change this value in the properties file? What is the name for the name value pair if so? Are there other enhancements I can make to support more users? Thanks, Aaron Longwell Selected Portions of Stack Trace: Used ConnectionManager instance could not obtain a connection: Could not borrow connection from pool - org.apache.ojb.broker.metadata.JdbcConnectionDescriptor: [EMAIL PROTECTED] jcd-alias=dovedb default-connection=true dbms=MySQL jdbc-level=2.0 driver=com.mysql.jdbc.Driver protocol=jdbc sub-protocol=mysql db-alias=//localhost/dove eager-release=false ConnectionPoolDescriptor={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=true} - 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]
Turning off the cache or marking chached objects stale
Hi, I am passing a serialized object through a JMS middleware. This is an object persisted using OJB and the object ends up being 'published' from one JVM and 'subscribed' to from another JVM. I presume because of the caching of persistent objects in OJB changes by the subscriber to the objects persistent state are not being reflected in the publishers side. Do I have to turn the caching off to get these database changes to be reflected and how do I do that. Or is there some mechanism that marks cached objects as stale when the state changes in the database without going through the OJB. And how do I do that? Kind regards, Paul Worrall Architect | Director Apcentric Limited The Soft Science of J2EE Deployment m: +44 (0) 77 1133 0213 w: http://www.apcentric.com/ http://www.apcentric.com/ outbind://10/www.apcentric.com www.apcentric.com Any opinions expressed in the email are those of the individual and not necessarily of the company. This email and any files transmitted with it are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the IT manager. Kind regards, Paul Worrall Commercial Director MJW Handling Services Limited Rising to the Challenge t: +44 (0) 870 204 1902 m: +44 (0) 77 1133 0213 w: www.mjw-handling.co.uk Any opinions expressed in the email are those of the individual and not necessarily of the company. This email and any files transmitted with it are confidential and solely for the use of the intended recipient. It may contain material protected by attorney-client privilege. If you are not the intended recipient or person responsible for delivering to the intended recipient, be advised that you have received this email in error and that any use is strictly prohibited. If you have received this email in error please notify the IT manager.