RE: OJB Reference Sites
Hi again, Oops, I forgort to mention the most important thing: Of course we are using OJB in those Systems! We have several OJB based systems now in production for over a year. We never had any OJB releated problems in production. Most problems we faced during development were related to the learning curve developers had to face that were new to O/R mapping. cheers, Thomas -Original Message- From: Mahler Thomas [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 2:52 PM To: 'OJB Users List' Subject: RE: OJB Reference Sites Hi Mike, My Company is building medium to large scale, mission critical applications (100 - 5.000 concurrent users) for our customers. Our largest customer is KarstadtQuelle, Europes largest retail company. The next big system that will go in production (in June) is the new logistics system for the stationary logistics of Karstadt. cheers, thomas -Original Message- From: Mike Williamson [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 2:45 PM To: OJB Users List Subject: OJB Reference Sites Hi, We're trying to build a case for using OJB on a new project. We're familiar with the tool - and have deployed several production applications already. However, our client is asking for a set of OJB references sites to give them reassurance that this thing is not a toy. Does anyone know of an existing list of reference sites for OJB? Can anyone on the list highlight companies already using OJB for real/production grade applications? Many thanks, Mike Williamson - 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: 1 to N mapping problems
On Wed, May 28, 2003 at 08:32:16PM +0800, Stephen Ting wrote: Hi Jens, You're right. That's means this setup won't work. If the Log and LogReceiveItem persisting to different table then it should be ok. Haven't try, just guessing. How to configure the repository to enable two classes(Log and LogReceiveItem, if LogReceiveItem inherit from Log) to persist to the same table with LOG_ID as primary key? That is easy, just define both classes as usual, with all their attributes, and map them to the same table. Storing items of both classes to the LOG-Table should work now without problems. The problem is when fetching items from db, say for class LogReceiveItem, you will get instances of model.LogReceiveItem with the data from all entries in table LOG, including those you inserted as model.Log, since OJB does not store the information about the class the data came from at storing time. You would have to prevent this by using appropriate filter criteria by yourself, i.e. look where the attributes which only LogReceiveItem has are null or not. I think you should separate the data into two tables and define a 1:1 relationship from LOG_RECEIVE_ITEM to LOG. Imho this would make the model clearer and easier to understand. Regards, Jens - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[Feature Request] retrieving a collection from reportqueries / paging with reportqueries
hi, i'm using report queries to retrieve external data (data from other systems). i'm using an empty classdescriptor for some kind of proxy-class that is dynamically modified for each request in which the proxy-class is mapped onto the table of the external data source. no field descriptors are defined (using columnnames), no need for them in this case. our own layers, using ojb underneath, would like to have Collections returned from queries (we might need to iterate over them more then once), also from the data retrieved from the external datasource. because the retrieved datasets might be large, we would like to be able to use setStartIndex/setEndIndex on reportqueries as well. currently, ojb returns an iterator as the result of a reportquery. are there any plans implementing it returning a Collections? and are there any plans of implementing the paging just like with 'normal' queries? thanx, Roger Janssen * The information contained in this communication is confidential and is intended solely for the use of the individual or entity to whom it is addressed.You should not copy, disclose or distribute this communication without the authority of iBanx bv. iBanx bv is neither liable for the proper and complete transmission of the information has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
R: SequenceManagerHighLowImpl: trouble on rc3
Hi, strange! Could you post a test case or add a test to one of the existing test cases to reproduce your problem? Yes it's strange, I noticed a couple of thing ... that could be wrong: First of all, the problem seems the storing of the HighLowSequence object. The maxKey attribute is a 'long' now, so in the repository-internal.xml the field descriptor of this attribute should be: field-descriptor name=maxKey column=MAX_KEY jdbc-type=BIGINT / instead of field-descriptor name=maxKey column=MAX_KEY jdbc-type=INTEGER / Anyway, using BIGINT the first store of the sequence works fine but the followings doesn't work and I got a ClassCastException on a java.lang.Integer object. Now I'm playing with some debug on the sequence classes to understand where this type mismatch could be generated. I'll try to setup a test case for this issue Thanks again Massimiliano Farnea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Feature Request] retrieving a collection from reportqueries / pa ging with reportqueries
Hi Roger, -Original Message- From: Janssen, Roger [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 3:02 PM To: 'OJB Users List' Subject: [Feature Request] retrieving a collection from reportqueries / pa ging with reportqueries hi, i'm using report queries to retrieve external data (data from other systems). i'm using an empty classdescriptor for some kind of proxy-class that is dynamically modified for each request in which the proxy-class is mapped onto the table of the external data source. no field descriptors are defined (using columnnames), no need for them in this case. our own layers, using ojb underneath, would like to have Collections returned from queries (we might need to iterate over them more then once), also from the data retrieved from the external datasource. because the retrieved datasets might be large, we would like to be able to use setStartIndex/setEndIndex on reportqueries as well. currently, ojb returns an iterator as the result of a reportquery. are there any plans implementing it returning a Collections? and are there any plans of implementing the paging just like with 'normal' queries? No there are no such plans currently. My suggestion would be to write a little wrapper class that implements collection and is backed by the Iterator returned from the PB. This CollectionIteratorWrapper can be very generic and it could also handle the paging stuff. I'd prefer not to add additional methods to the PB interface but use such a wrapper. It should be fun to write, and I'll promise to add all contributions to the codebase ;-) cheers, Thomas thanx, Roger Janssen ** *** The information contained in this communication is confidential and is intended solely for the use of the individual or entity to whom it is addressed.You should not copy, disclose or distribute this communication without the authority of iBanx bv. iBanx bv is neither liable for the proper and complete transmission of the information has been maintained nor that the communication is free of viruses, interceptions or interference. If you are not the intended recipient of this communication please return the communication to the sender and delete and destroy all copies. - 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: OJB Reference Sites
On Wed, May 28, 2003 at 01:44:39PM +0100, Mike Williamson wrote: Hi, We're trying to build a case for using OJB on a new project. We're familiar with the tool - and have deployed several production applications already. However, our client is asking for a set of OJB references sites to give them reassurance that this thing is not a toy. Does anyone know of an existing list of reference sites for OJB? Can anyone on the list highlight companies already using OJB for real/production grade applications? We use OJB as backend in several WebObjects Intranet Applications we develop for a mid-sized company (300 employees). It replaces the standard Enterprise Objects Framework of WO. We do this since we found OJB simply to be more useable than EOF. Latest application using OJB is the website of enviaM, a german energy provider (www.enviam.de). hth, Jens - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handle broken database connections
Hi Reinhard, - Original Message - From: Reinhard Dunst [EMAIL PROTECTED] To: OJB-Users-List (E-mail) [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:13 PM Subject: Handle broken database connections Hi, how can I handle broken database connections. If I shut down the database and restart it, you could use the 'validationQuery' attribute within the connection-pool element to check connection before it could be obtained from pool. currently we don't have a 'refresh()' method on ConnectionFactory level to allow the implementation class to refresh their connection pool - if con-pooling was supported. Would such a 'refresh' method make sense? regards, Armin I get following errormessage occure: [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: PersistenceBrokerException during the execution of the query: Io exception: Connection reset by peer: socket write error Io exception: Connection reset by peer: socket write error java.sql.SQLException: Io exception: Connection reset by peer: socket write error My current configuration is java 1.4.1 ojb 1.0 rc2 Thanks in advance Reinhard == Reinhard Dunst T.U.B. Technologie- Unternehmensberatung GmbH mobile: +43.664 - 2525928 email: mailto:[EMAIL PROTECTED] == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Update objects suggestion
After using OJB on a number of web projects, I keep encountering the same problem of updating partial object data from a struts form. for example, an object might contain 10 fields, with one PK and a few FKs. the form however, only contains 5 fields. Since the update action doesn't get a hold of the full object, I either have to put the original object in the session scope or re-query it inside the update action for a second time. It seems like an updateOnly method might come in handy for such operations. Basically, it would work like store(), but instead of updating every single field, it would update all the non-null members of the class and throw an exception of the object is not already in the database. Another way, might be to convert identity objects to a String and be able to use that string to create a new identity object in the update action to use that for retrieval so that the cache would be hit. What do you guys think? How are you guys solving this problem? Thanks Caster - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OJB System Test ISSUES
I've developed a application with Struts, OJB rc3, Oracle App Serv OC4J 903 and Oracle 8 DB. Now I'm stress-testing the application with JMeter: 5 concurrent users with 3 different http request. Some questions: 1) It seems that the begin, commit and abort transaction funct have effect to all the connections of the pool of the PB. That's correct? I've followed a previous suggestion (open a PB before the begin-tras and close it after the commit) but I does not work correcly. 2) If a connection-pool is full, how can I prevent any operation before? I mean: can I check if the broker can perform a query or an insert before to do that? Thanks Pier - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB System Test ISSUES
Hi Pier, - Original Message - From: Pierfranco Lai [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:02 PM Subject: OJB System Test ISSUES I've developed a application with Struts, OJB rc3, Oracle App Serv OC4J 903 and Oracle 8 DB. Now I'm stress-testing the application with JMeter: 5 concurrent users with 3 different http request. Some questions: 1) It seems that the begin, commit and abort transaction funct have effect to all the connections of the pool of the PB. How does it effect all connections? That's correct? I don't hope so ;-) I've followed a previous suggestion (open a PB before the begin-tras and close it after the commit) but I does not work correcly. OJB was shipped with a simple multithreaded test. This test does not point out any problems. call 'bin\build.bat perf-test' Do you use OJB within EJB's? 2) If a connection-pool is full, how can I prevent any operation before? I mean: can I check if the broker can perform a query or an insert before to do that? (Don't know if I understand your question) No, but you can setup different scenarios when pool is exhausted: - throw exception - wait for next returned connection (recommended only for multithreaded environments) - grow regards, Armin Thanks Pier - 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: Alias troubles (was: M to N alias/join troubles)
hi michael, you should not use the name of a relationship in a user alias, in the best case it will have no effect ;) when you do not define your own alias ojb uses the name of the relationship as 'internal' alias. i'll have a look at your problem using an empty criteria. hth jakob Michael Hart wrote: In response to myself: Criteria main_crit = new Criteria(); main_crit.setAlias(project); Criteria persons_crit = new Criteria(); persons_crit.setAlias(persons); persons_crit.addEqualTo(persons.id,2); main_crit.addAndCriteria(persons_crit); Query query = new QueryByCriteria(Project.class, main_crit); Generates this: SELECT A0.TITLE,A0.DESCRIPTION,A0.ID FROM PROJECT A0 INNER JOIN PERSON_PROJECT A1 ON A0.ID=A1.PROJECT_ID INNER JOIN PERSON A2 ON A1.PERSON_ID=A2.ID WHERE A4.ID = 2 I've just played some more, and putting the main_crit.setAlias at the end of the code block works fine (this is true for the other examples as well): Criteria main_crit = new Criteria(); Criteria persons_crit = new Criteria(); persons_crit.setAlias(persons); persons_crit.addEqualTo(persons.id,2); main_crit.addAndCriteria(persons_crit); main_crit.setAlias(project); All works... So this, plus the other examples, leads me to the following rule-of-thumb: * If you are going to set aliases for a particular set of Criteria, you must ensure that the name of the first alias you set reflects the name of a property of the class you wish to query. After that, you may set alias names to be whatever you wish. * Does that sound right to you, or have I just generated some really weird test cases? In any case, I still think it's slightly, slightly buggy... ? (But much better) Cheers, Michael - 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]
RemovalAwareList status
Any news? Thanks, Edson Richter --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.484 / Virus Database: 282 - Release Date: 27/5/2003 smime.p7s Description: S/MIME cryptographic signature
R: OJB System Test ISSUES
Hi Armin, -Messaggio originale- Da: Armin Waibel [mailto:[EMAIL PROTECTED] Inviato: mercoledì 28 maggio 2003 18.45 A: OJB Users List Oggetto: Re: OJB System Test ISSUES Hi Pier, - Original Message - From: Pierfranco Lai [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:02 PM Subject: OJB System Test ISSUES I've developed a application with Struts, OJB rc3, Oracle App Serv OC4J 903 and Oracle 8 DB. Now I'm stress-testing the application with JMeter: 5 concurrent users with 3 different http request. Some questions: 1) It seems that the begin, commit and abort transaction funct have effect to all the connections of the pool of the PB. How does it effect all connections? Suppose you have 2 simultaneous threas (two users performing the same INSERT). Normally the steps are: 1 - PB Creation 2 - PB beginTransation 3 - PB store 4 - PB commitTransaction 4.1 - Exception PB abortTransaction When the first user thread perform the commitTrans, the second user get an Excpetion (ConnectionManager is NOT in transaction). That's correct? I don't hope so ;-) I don't too ;-))) I've followed a previous suggestion (open a PB before the begin-tras and close it after the commit) but I does not work correcly. OJB was shipped with a simple multithreaded test. This test does not point out any problems. call 'bin\build.bat perf-test' Do you use OJB within EJB's? 2) If a connection-pool is full, how can I prevent any operation before? I mean: can I check if the broker can perform a query or an insert before to do that? (Don't know if I understand your question) No, but you can setup different scenarios when pool is exhausted: - throw exception - wait for next returned connection (recommended only for multithreaded environments) - grow regards, Armin Thanks Pier - 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]
class descriptors data views
Hi Folks, Just looking for a way to retrieve different views of data, the scenario is this. I have a table (table1) with a relationship to another table (table2), at times I may want to retrieve all the information from table1 and the related information from table2, however, there are other times when I may only wish to retrieve a summary of information from table1. I've tried this by setting up two different value objects, one that contains a full view and the other as a summary view - then built a matching class-descriptor for each. When I run my query in both situations it appears to work, however the debug shows me something that I wouldn't expect when running the summary query, it shows that the executeQuery is using the summary class as expected, however, the actual SQL shows a select that contains ALL of the columns on the table (in this example table1). If I proceed to comment out the class-descriptor that reflects the full view and re-run my summary test the SQL is as I expect containing only the summary fields - if this makes sense does anyone have any idea of what I might be doing wrong? I thought this was doable but maybe I have to approach getting different views of data in another way. Any input is appreciated, thanks. Joe - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: RemovalAwareList status
no new status so far :-( Edson Carlos Ericksson Richter wrote: Any news? Thanks, Edson Richter --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.484 / Virus Database: 282 - Release Date: 27/5/2003 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What broker gets used by proxies?
Can anyone help answer this question: What broker is used to fill proxied collections when the original broker has been returned to the pool? Thanks David If I do the following pseudo code what broker is used to fill the proxies? get a broker execute a query and get back some contact objects. close the broker access the proxied list of emailaddresses for a contact Does the contact remember which broker was used to fill itself and use that again to get the proxied objects? OR Does the contact get a new broker, use it and close it? If it is the first of these then I guess I am going to get potential multi-user issues as someone else may have started to use that broker by the time contact needs to load it's proxied objects. So do I need to keep hold of a broker until I have finished all the operations on all the objects I get from that broker? -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: global oid
Just add an attribute globalSequenceId with a value of true to the entry for the sequence manager in your repository file. sequence-manager className=org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=globalSequenceId attribute-value=true/ /sequence-manager -Original Message- From: battjt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:06 PM To: OJB Users List Subject: global oid I'm still trying to port our applications from Poet to OJB. Poet has a concept of an object ID, OID. I added the id as a field on each of our objects and map that to the ID column from Poet. The problem is that the OID is global. Given a long, Poet returns an Object. 'Identity's in OJB are not global, but instead scoped to a class. Anyone have a pattern to work around this? (Possible I'm just completely lost. I was using Longs for my ids, but org.apache.ojb.jdori.sql.OjbStoreManager.getPCClassForOid was throwing a class cast exception, so I assumed that I needed to use org.apache.ojb.broker.Identity for my ids.) Thanks again, Joe - 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: Alias troubles
hi michael, fixed the bogus sql bug. please use the latest SqlQueryStatement from repository. jakob Michael Hart wrote: Hi Jakob, i did some tests with empty criteria and imo this works ok: Oops... you're right - the example I gave was too minimal :-) Here's a better one: Criteria main_crit = new Criteria(); main_crit.setAlias(project); Criteria persons_crit = new Criteria(); persons_crit.setAlias(persons); persons_crit.addEqualTo(persons.id,2); main_crit.addAndCriteria(persons_crit); Query query = new QueryByCriteria(Project.class, main_crit); Generates this: SELECT A0.TITLE,A0.DESCRIPTION,A0.ID FROM PROJECT A0 INNER JOIN PERSON_PROJECT A1 ON A0.ID=A1.PROJECT_ID INNER JOIN PERSON A2 ON A1.PERSON_ID=A2.ID WHERE A4.ID = 2 In the previous code snippet, if you don't set the alias for main_crit, then it works fine. However, I got some weird results with other combinations and it took me quite a while to realise that the name you give in the alias makes quite a difference (as you may have hinted at in one of your previous e-mails). For example: Criteria main_crit = new Criteria(); Criteria roles_crit = new Criteria(); roles_crit.setAlias(roles); roles_crit.addEqualTo(roles.roleName,whatever); main_crit.addAndCriteria(roles_crit); Query query = new QueryByCriteria(Person.class, main_crit); Works fine, but changing the setAlias line to: roles_crit.setAlias(roles1); generates this bogus SQL: SELECT A0.LASTNAME,A0.FIRSTNAME,A0.ID FROM PERSON A0 INNER JOIN PERSON_PROJECT A1 ON A0.ID=A1.PERSON_ID WHERE A2.ROLENAME = 'whatever' But then adding another one (with a different alias) works (!): Criteria main_crit = new Criteria(); Criteria roles_crit = new Criteria(); roles_crit.setAlias(roles); roles_crit.addEqualTo(roles.roleName,whatever); main_crit.addAndCriteria(roles_crit); Criteria roles2_crit = new Criteria(); roles2_crit.setAlias(roles2); roles2_crit.addEqualTo(roles.roleName,hello); main_crit.addAndCriteria(roles2_crit); Query query = new QueryByCriteria(Person.class, main_crit); Note that if roles_crit is removed, or its setAlias changed, then it breaks again. In this example, as long as you have the first Criteria with an alias roles, then you can add other Criteria with whatever alias you want. This is also true for other aliases to other classes: Criteria main_crit = new Criteria(); Criteria roles_crit = new Criteria(); roles_crit.setAlias(roles); roles_crit.addEqualTo(roles.roleName,whatever); main_crit.addAndCriteria(roles_crit); Criteria proj_crit = new Criteria(); proj_crit.setAlias(projects1); proj_crit.addEqualTo(projects.id,2); main_crit.addAndCriteria(proj_crit); Query query = new QueryByCriteria(Person.class, main_crit); Works fine, and likewise so does: Criteria main_crit = new Criteria(); Criteria proj_crit = new Criteria(); proj_crit.setAlias(projects); proj_crit.addEqualTo(projects.id,2); main_crit.addAndCriteria(proj_crit); Criteria roles2_crit = new Criteria(); roles2_crit.setAlias(roles2); roles2_crit.addEqualTo(roles.roleName,hello); main_crit.addAndCriteria(roles2_crit); Query query = new QueryByCriteria(Person.class, main_crit); In any of the previous examples, if main_crit.setAlias is invoked, it breaks again, unless of course you add a criteria to it, eg main_crit.addLike(...). Very confused :-) Michael - 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: OJB System Test ISSUES
Hi again, each thread have to use it's on PB instance -- different connections Normally the steps are: 0. get PB instance from pool (1 - PB Creation) 2 - PB beginTransation 3 - PB store 4 - PB commitTransaction 5. do PB.close() in finally block to return PB instance back to pool. regards, Armin - Original Message - From: Pierfranco Lai [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 7:18 PM Subject: R: OJB System Test ISSUES Hi Armin, -Messaggio originale- Da: Armin Waibel [mailto:[EMAIL PROTECTED] Inviato: mercoledì 28 maggio 2003 18.45 A: OJB Users List Oggetto: Re: OJB System Test ISSUES Hi Pier, - Original Message - From: Pierfranco Lai [EMAIL PROTECTED] To: 'OJB Users List' [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 6:02 PM Subject: OJB System Test ISSUES I've developed a application with Struts, OJB rc3, Oracle App Serv OC4J 903 and Oracle 8 DB. Now I'm stress-testing the application with JMeter: 5 concurrent users with 3 different http request. Some questions: 1) It seems that the begin, commit and abort transaction funct have effect to all the connections of the pool of the PB. How does it effect all connections? Suppose you have 2 simultaneous threas (two users performing the same INSERT). Normally the steps are: 1 - PB Creation 2 - PB beginTransation 3 - PB store 4 - PB commitTransaction 4.1 - Exception PB abortTransaction When the first user thread perform the commitTrans, the second user get an Excpetion (ConnectionManager is NOT in transaction). That's correct? I don't hope so ;-) I don't too ;-))) I've followed a previous suggestion (open a PB before the begin-tras and close it after the commit) but I does not work correcly. OJB was shipped with a simple multithreaded test. This test does not point out any problems. call 'bin\build.bat perf-test' Do you use OJB within EJB's? 2) If a connection-pool is full, how can I prevent any operation before? I mean: can I check if the broker can perform a query or an insert before to do that? (Don't know if I understand your question) No, but you can setup different scenarios when pool is exhausted: - throw exception - wait for next returned connection (recommended only for multithreaded environments) - grow regards, Armin Thanks Pier - 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]
Help on 1:1 associations
GentleFolk, I'd love someone to point me to the junit example of the 1:1 association, particularily one that stores the associated object tree. I've looked at the OneToOneTest,PersistenceBrokerTest, and BrokerExamples without a clue as to how it should be done. Maybe I don't understand, but I'd like to create the object tree, and do a store like so: A parent has a child. I'd like both to be auto created (db wise). I'd like to create the parent object, create the child, do a parent.setChild(child)and say: broker.store(parent) only. I'd like to have the child with a new id, the parent with a new id and the child with the parent's id as the reference. I've been successful with storing the child (navigation from the child to the parent only), but so far (as in the OneToOneTest), I've not been able to do the above without doing stores on both the parent and child. Am I being unreasonable? I've followed the ProductGroup, Article examples assiduously, but with reference to the junit test, I can't see that it actually works the way I've articulated. So, maybe it doesn't. Do I have to programmatically store on both the parent and the child? -hba - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OJB + commercial JDO ?
Has anyone used OJB with a commercial JDO implementation? (esp. Solar Metric?) If so, could you give an idea of the work required to integrate the two? thanks, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: global oid
What you need to do, is create a class-descriptor that describes Object, and all it's persistent derivative objects. Then OIDs are unique across the whole system, and more imporantly when you load an Object.class with OID 5, it will know it has to look at all the tables to find it. |-+--- | | battjt | | | [EMAIL PROTECTED]| | | ign.net| | | | | | 05/28/2003 03:27| | | PM | | | Please respond | | | to OJB Users | | | List | | | | |-+--- --| | | |To: OJB Users List [EMAIL PROTECTED] | |cc: | |Subject: Re: global oid | | | --| Then how do I convert '5' into an object? Don't I still need to use a org.apache.ojb.broker.Identity? How do I allocate an Identity if I don't know the class? Joe Lance Eason wrote: Just add an attribute globalSequenceId with a value of true to the entry for the sequence manager in your repository file. sequence-manager className =org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=globalSequenceId attribute-value =true/ /sequence-manager -Original Message- From: battjt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:06 PM To: OJB Users List Subject: global oid I'm still trying to port our applications from Poet to OJB. Poet has a concept of an object ID, OID. I added the id as a field on each of our objects and map that to the ID column from Poet. The problem is that the OID is global. Given a long, Poet returns an Object. 'Identity's in OJB are not global, but instead scoped to a class. Anyone have a pattern to work around this? (Possible I'm just completely lost. I was using Longs for my ids, but org.apache.ojb.jdori.sql.OjbStoreManager.getPCClassForOid was throwing a class cast exception, so I assumed that I needed to use org.apache.ojb.broker.Identity for my ids.) Thanks again, Joe - 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: What broker gets used by proxies?
Hi David, - Original Message - From: David Warnock [EMAIL PROTECTED] To: OJB Users List [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 7:59 PM Subject: Re: What broker gets used by proxies? Can anyone help answer this question: What broker is used to fill proxied collections when the original broker has been returned to the pool? Proxy was associated with PBKey of the 'original' broker and try find an open PB instance with the same PBKey for the current thread, else PB-pool was ask for a new PB instance. see CollectionProxy#getBroker() regards, Armin Thanks David If I do the following pseudo code what broker is used to fill the proxies? get a broker execute a query and get back some contact objects. close the broker access the proxied list of emailaddresses for a contact Does the contact remember which broker was used to fill itself and use that again to get the proxied objects? OR Does the contact get a new broker, use it and close it? If it is the first of these then I guess I am going to get potential multi-user issues as someone else may have started to use that broker by the time contact needs to load it's proxied objects. So do I need to keep hold of a broker until I have finished all the operations on all the objects I get from that broker? -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. - 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]
SQLException is not thrown when Oracle constrain Voilation occurs
When I try to do broker.store(Myobject.class), if a violation of Oracle constrain occurs, OJB seems to eat up the error message and doesn't display any warning or error message at all. Is this the normal behavior of OJB or did I miss any thing? Thank you! Lucy
Re: What broker gets used by proxies?
Armin, Whew, thanks. Panic over. Still I am re-architecuring a bit for performance so the original broker will be around long enough with it's cache. Proxy was associated with PBKey of the 'original' broker and try find an open PB instance with the same PBKey for the current thread, else PB-pool was ask for a new PB instance. see CollectionProxy#getBroker() -- David Warnock, Sundayta Ltd. http://www.sundayta.com iDocSys for Document Management. VisibleResults for Fundraising. Development and Hosting of Web Applications and Sites. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: global oid
java.lang.Object doesn't have an ID field. Are you suggesting that I change my datamodel to have a single peristable super class? Joe [EMAIL PROTECTED] wrote: What you need to do, is create a class-descriptor that describes Object, and all it's persistent derivative objects. Then OIDs are unique across the whole system, and more imporantly when you load an Object.class with OID 5, it will know it has to look at all the tables to find it. removed huge sig Then how do I convert '5' into an object? Don't I still need to use a org.apache.ojb.broker.Identity? How do I allocate an Identity if I don't know the class? Joe Lance Eason wrote: Just add an attribute globalSequenceId with a value of true to the entry for the sequence manager in your repository file. sequence-manager className =org.apache.ojb.broker.util.sequence.SequenceManagerHighLowImpl attribute attribute-name=grabSize attribute-value=20/ attribute attribute-name=globalSequenceId attribute-value =true/ /sequence-manager -Original Message- From: battjt [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:06 PM To: OJB Users List Subject: global oid I'm still trying to port our applications from Poet to OJB. Poet has a concept of an object ID, OID. I added the id as a field on each of our objects and map that to the ID column from Poet. The problem is that the OID is global. Given a long, Poet returns an Object. 'Identity's in OJB are not global, but instead scoped to a class. Anyone have a pattern to work around this? (Possible I'm just completely lost. I was using Longs for my ids, but org.apache.ojb.jdori.sql.OjbStoreManager.getPCClassForOid was throwing a class cast exception, so I assumed that I needed to use org.apache.ojb.broker.Identity for my ids.) Thanks again, Joe
RE: Alias troubles
fixed the bogus sql bug. please use the latest SqlQueryStatement from repository. Beautiful! It seems to work perfectly - I haven't been able to break it yet ;-) you should not use the name of a relationship in a user alias, in the best case it will have no effect ;) Ah really? Well it was working :-) (and still does I think). Perhaps this should also be something to go in the docs. Anyway, thank-you for your patience and help. Cheers, Michael P.S. Thanks also to Armin for fixing up OJB.properties - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
anonymous fields
Hello All, I've tried to use such scheme as described at : http://cvs.apache.org/viewcvs/db-ojb/xdocs/howto-use-anonymous-keys.xml?rev=HEADcontent-type=text/vnd.viewcvs-markup but I got such exception :(. In few words my prog contains 3 classes class A contains collection B collection C B contains collection B C contains String Name I put all these classes into a separate tables. tableA _id tableB _id - I use this field as foreign key for collection from class B, is it correct? Maybe I have to add additional field to the table B for having another key? _idA foreign key for collection from class A tableC _id _idA foreign key for collection from class A all this fields I've described as anonymous. in this exception userDefinitionScreenID - _idA CompositeControlDefinition - class B thank you . org.apache.ojb.broker.OJBRuntimeException: Incorrect field reference userDefinitionScreenID in [EMAIL PROTECTED] delete=false,cascade retrieve=true,cascade store=false,is lazy=false,class of Items=class efi.base.presentation.formdefinition.CompositeControlDefinition] at org.apache.ojb.broker.metadata.ObjectReferenceDescriptor.getForeignKeyFieldDescriptors(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.assertFkAssignment(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.assignReferenceFKs(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:198) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:143) at efi.base.persistent.PersistentLayerManager.main(PersistentLayerManager.java:90) rethrown as org.apache.ojb.broker.PersistenceBrokerException: Incorrect field reference userDefinitionScreenID in [EMAIL PROTECTED] delete=false,cascade retrieve=true,cascade store=false,is lazy=false,class of Items=class efi.base.presentation.formdefinition.CompositeControlDefinition] at org.apache.ojb.odmg.TransactionImpl.assertFkAssignment(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.assignReferenceFKs(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:198) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:143) at efi.base.persistent.PersistentLayerManager.main(PersistentLayerManager.java:90) rethrown as org.apache.ojb.broker.PersistenceBrokerException: Incorrect field reference userDefinitionScreenID in [EMAIL PROTECTED] delete=false,cascade retrieve=true,cascade store=false,is lazy=false,class of Items=class efi.base.presentation.formdefinition.CompositeControlDefinition] at org.apache.ojb.odmg.TransactionImpl.assignReferenceFKs(Unknown Source) at org.apache.ojb.odmg.TransactionImpl.lock(Unknown Source) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:198) at efi.base.persistent.PersistentLayerManager.store(PersistentLayerManager.java:143) at efi.base.persistent.PersistentLayerManager.main(PersistentLayerManager.java:90) -- Best regards, Alexander mailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: anonymous fields
Hi Alexander Is userDefinitionScreenID a field defined in your mapping? ie. this has to be the name attribute of a field-descriptor definition. Something like: field-descriptor name=userDefinitionScreenID column=_idA jdbc-type=INTEGER access=anonymous/ Maybe if you post the relevant sections of your repository_user.xml file it could help identify the problem. -Raymond Barlow Alexander Prozor wrote: Hello All, I've tried to use such scheme as described at : http://cvs.apache.org/viewcvs/db-ojb/xdocs/howto-use-anonymous-keys.xml?rev=HEADcontent-type=text/vnd.viewcvs-markup but I got such exception :(. In few words my prog contains 3 classes class A contains collection B collection C B contains collection B C contains String Name I put all these classes into a separate tables. tableA _id tableB _id - I use this field as foreign key for collection from class B, is it correct? Maybe I have to add additional field to the table B for having another key? _idA foreign key for collection from class A tableC _id _idA foreign key for collection from class A all this fields I've described as anonymous. in this exception userDefinitionScreenID - _idA CompositeControlDefinition - class B thank you . org.apache.ojb.broker.OJBRuntimeException: Incorrect field reference userDefinitionScreenID in [EMAIL PROTECTED] delete=false,cascade retrieve=true,cascade snip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re[2]: anonymous fields
Hello Raymond, sure, I've defined this field in mapping. there are ddl and repository_user.xml files from this project. RB Is userDefinitionScreenID a field defined in your mapping? ie. this RB has to be the name attribute of a field-descriptor definition. Something RB like: RB field-descriptor RB name=userDefinitionScreenID RB column=_idA RB jdbc-type=INTEGER RB access=anonymous/ RB Maybe if you post the relevant sections of your repository_user.xml file RB it could help identify the problem. -- Best regards, Alexandermailto:[EMAIL PROTECTED] class-descriptor class=efi.base.presentation.formdefinition.UserScreenDefinition table=GUIComponentDefinitionTable field-descriptor name=internal_id column=internal_id jdbc-type=INTEGER primarykey=true autoincrement=true access=anonymous / field-descriptor name=name column=name jdbc-type=VARCHAR / field-descriptor name=type column=type jdbc-type=VARCHAR / field-descriptor name=id column=id jdbc-type=VARCHAR / field-descriptor name=value column=value jdbc-type=VARCHAR / collection-descriptor name=dataDefinitionRefs element-class-ref=efi.base.presentation.formdefinition.DataDefinitionRef inverse-foreignkey field-ref=userDefinitionScreenID/ /collection-descriptor reference-descriptor name=rootControlDef class-ref=efi.base.presentation.formdefinition.CompositeControlDefinition foreignkey field-ref=userDefinitionScreenID/ /reference-descriptor /class-descriptor class-descriptor class=efi.base.presentation.formdefinition.DataDefinitionRef table=DataDefinitionRefTable field-descriptor name=internal_id column=internal_id jdbc-type=INTEGER primarykey=true autoincrement=true access=anonymous / field-descriptor name=queryDefName column=queryDefName jdbc-type=VARCHAR / field-descriptor name=dataDefName column=dataDefName jdbc-type=VARCHAR / field-descriptor name=userDefinitionScreenID column=userDefinitionScreenID jdbc-type=INTEGER access=anonymous / /class-descriptor class-descriptor class=efi.base.presentation.formdefinition.CompositeControlDefinition table=ControlDefinitionTable field-descriptor name=internal_id column=internal_id jdbc-type=INTEGER primarykey=true autoincrement=true access=anonymous / field-descriptor name=name column=name jdbc-type=VARCHAR / field-descriptor name=type column=type jdbc-type=VARCHAR / field-descriptor name=id column=id jdbc-type=VARCHAR / field-descriptor name=value column=value jdbc-type=VARCHAR / field-descriptor name=properties column=properties_map jdbc-type=VARCHAR conversion=org.apache.ojb.broker.accesslayer.conversions.Object2Base64StringFieldConversion / field-descriptor name=dataDefName column=dataDefName jdbc-type=VARCHAR / field-descriptor name=modelReference column=modelReference jdbc-type=VARCHAR / field-descriptor name=userDefinitionScreenID column=userDefinitionScreenID jdbc-type=INTEGER access=anonymous / field-descriptor name=selfReferenceID column=selfReferenceID jdbc-type=INTEGER access=anonymous / collection-descriptor name=controls element-class-ref=efi.base.presentation.formdefinition.CompositeControlDefinition inverse-foreignkey field-ref=selfReferenceID/ /collection-descriptor /class-descriptor CREATE TABLE GUIComponentDefinitionTable ( internal_id INTEGER PRIMARY KEY, name VARCHAR(52) NOT NULL, type VARCHAR(52) NOT NULL, value VARCHAR(52) NOT NULL, id VARCHAR(52) NOT NULL ); CREATE TABLE DataDefinitionRefTable( internal_id INTEGER PRIMARY KEY, dataDefName VARCHAR(30) NOT NULL, queryDefName VARCHAR(30) NOT NULL, userDefinitionScreenID INTEGER, FOREIGN KEY (userDefinitionScreenID) REFERENCES GUIComponentDefinitionTable(internal_id ) ); CREATE TABLE ControlDefinitionTable ( internal_id INTEGER PRIMARY KEY, name VARCHAR(52) NOT
Re: anonymous fields
Hi Alexander, You're right. I've not used anonymous keys like this before (although, I do use them in my app). Maybe I should look further into it! Sorry I couldn't help-just thought I'd have a go ;) Cheers, Raymond Alexander Prozor wrote: Hello Raymond, I think now if example is correct: http://cvs.apache.org/viewcvs/db-ojb/xdocs/howto-use-anonymous-keys.xml?rev=HEADcontent-type=text/vnd.viewcvs-markup Desk contains collection of things and reference to the finish . It's almost identical to my app :(. but for me it doesn't work. But only for CompositeControlDefinition for DataDefinitionRef all works ok. -- Regards, Raymond Barlow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Handle broken database connections
Hi Armin, yes I think so. A 'refresh()' would make sense. Because there are a lot of situations where the connection to the database can be lost. And when I look in archive for similar situations, there are some of them. I saw, there is just a 'connection.isClosed()' in ConnectionFactoryConPooledImpl.validateObject() and a lost connection is already open. And additionaly the connection will be checked only if a broker will be borrowed. What do you think about my actual workaround? public void checkConnection() throws MyConnectionFailException { try { // try a fast testquery like 'select 1 from dual' in oracle Object obj = broker.getObjectByQuery(query); } catch (Exception ex) { try { PersistenceBrokerFactory.releaseAllInstances(); broker = PersistenceBrokerFactory.createPersistenceBroker(...); } catch (Exception ex) { throw new MyConnectionFailException(); } } } Thanks in advance, Reinhard -Original Message- From: Armin Waibel [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 3:13 PM To: OJB Users List Subject: Re: Handle broken database connections Hi Reinhard, - Original Message - From: Reinhard Dunst [EMAIL PROTECTED] To: OJB-Users-List (E-mail) [EMAIL PROTECTED] Sent: Wednesday, May 28, 2003 1:13 PM Subject: Handle broken database connections Hi, how can I handle broken database connections. If I shut down the database and restart it, you could use the 'validationQuery' attribute within the connection-pool element to check connection before it could be obtained from pool. currently we don't have a 'refresh()' method on ConnectionFactory level to allow the implementation class to refresh their connection pool - if con-pooling was supported. Would such a 'refresh' method make sense? regards, Armin I get following errormessage occure: [org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR: PersistenceBrokerException during the execution of the query: Io exception: Connection reset by peer: socket write error Io exception: Connection reset by peer: socket write error java.sql.SQLException: Io exception: Connection reset by peer: socket write error My current configuration is java 1.4.1 ojb 1.0 rc2 Thanks in advance Reinhard == Reinhard Dunst T.U.B. Technologie- Unternehmensberatung GmbH mobile: +43.664 - 2525928 email: mailto:[EMAIL PROTECTED] == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]