RE: how to send a real SQL query to OJB
Hi Armin, I have seen the FAQ. Thanks. But it doesn't work for me. My SQL query is "select workstationName from Workstation". >From my database query analyzer, this query retrieves 36 rows. In OJB I try: code String sql = "select workstationName from Workstation"; Query query = QueryFactory.newQuery(Workstation.class, sql); try { broker.beginTransaction(); Collection col = broker.getCollectionByQuery(query); int size = col.size(); System.out.println(size); broker.commitTransaction(); } catch (Throwable t) { broker.abortTransaction(); t.printStackTrace(); } code The problem is that the size of the collection is 0! OJB doesn't retrieve anything! But if I try the query "select * from Workstation", it works!! Have you an idea what's the problem? I'm using OJB 0.9.5. Thanks Sylvain -Message d'origine- De: Armin Waibel [mailto:[EMAIL PROTECTED] Date: mercredi, 19. mars 2003 16:12 À: OJB Users List Objet: Re: how to send a real SQL query to OJB Hi Sylvain, see FAQ http://db.apache.org/ojb/faq.html topic "Is it possible to perform my own sql-queries in OJB?" + "Can I directly obtain a java.sql.Connection within OJB?" regards, Armin - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 19, 2003 4:05 PM Subject: how to send a real SQL query to OJB Hello, I have a String variable which contains a real SQL query like this: "SELECT distinct(workstationName) FROM Workstation w, WntWorkstation t, Package p, Package_Workstation r WHERE (w.workstationName like '%' or w.workstationName is NULL) order by w.workstationName" How can I send this query (as written above) to OJB? Thanks Sylvain - 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]
What happens when an insert with ODMG fails?
Hi, following question about storing a new object: I have an Object with an attribute ID of type BigDecimal. I write the Object with ODMG: ... tx.lock(myObject, Transaction.WRITE); tx.commit(); if I set the ID to a valid number the every thing works fine. if I set the ID to a number witch still exists then no insert is made, but also not exception is thrown. Is there a way to find out if the insert was successful or not? regards Matthias Roth - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Can I capture the JDBC behavior?
Hello Is there a way of capturing the JDBC driver behaviour using the ODMG api? I wish to override the behaviour of the JDBC driver when an invalid password is provided. Thanks Shane Shane Mingins Analyst Programmer Assure NZ Ltd Ph 644 494 2522
resetting an object to persistence store state.
What is the best way to reset an object to reflect its persisted state? Yuji Shinozaki Computer Systems Senior Engineer [EMAIL PROTECTED] Advanced Technologies Group (804)924-7171 Information Technology & Communication http://www.people.virginia.edu/~ys2nUniversity of Virginia - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Trouble with 1:n relationships!?...
Greetings all... I'm trying to set up a simple 1:n relationship where object A contains a Vector of object Bs. I've read through the documentation, and as far as I can tell, I've set everything up correctly: - Object A contains a Vector called objectBs (hypothetically). - Object B contains an aId attribute. This is an int. - I've created the two tables in the database... The B table contains a a_id field. This is an INTEGER (I'm using PostgreSQL by the way). I've populated both tables, and have confirmed that the data is, in fact, there (by running the appropriate SQL statements manually). - I've set up repository_user.xml as follows: ... A m:n relationship that is working fine goes here ... ... Having done this, no B-related data comes back! As I said, if I execute "select * from b where a_id = whatever", I get data back. Additionally, the rest of object A comes back fine. I've tried to look through the mailing list archives, but the archives/search capability seems to be down. Any suggestions would be greatly appreciated... My level of frustration is high! Particualrly as I've managed to implement all the multi-level m:n relationships that I need without any problems... Now I'm stuck getting a silly 1:n relationship to work... :-/ Cheers... Davide Bruzzone - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Query on composite pattern
Hi Jakob, b. IMHO this solution is not good because you don't know which a extent class to choose. What if name of a descriptor is the same for many extent? a. IMHO this is solution. I think that a path could use a cast operator like in OQL. For 2 case it could be: // (TestSuite)test.(TestCase)test.caseName crit.addEqualTo( "("+TestSuite.class.getName()+")test.(+"TestCase.class.getName()"+)test.caseName", "test 3"); but it is not readable for me so may be like this: crit.addEqualTo("($1)test.($2)test.caseName", "test 3"); crit.addPathClass (TestSuite.class); crit.addPathClass (TestCase.class); ??? regards, Dariusz Kies --- Jakob Braeuchi <[EMAIL PROTECTED]> wrote: > hi dariusz, > > i'm thinking of the following solution to this problem: > > a.) pass the hints to getAttributeDescriptorsForPath > b.) in getAttributeDescriptorsForPath i'd like to scan the extents if a > descriptor can't be found in the class. > > what do you think ? > > jakob > > Dariusz Kies wrote: > > >Hi, > > > >Here is the sql for 3: > >[org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: > >SQL: SELECT A0.ID,A0.ID_TEST FROM FI.T_FOO A0,FI.T_TEST_SUITE A1 WHERE > >A0.ID_TEST=A1.ID AND (caseName = ? ) > > > >Notice that there isn't the column name for the caseName attribute and there > >isn't join with FI.T_TEST_CASE. > >I debug a little and I found that a problem is in the class > >org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement, method > getTableAlias > >and call > >descriptors = getRoot().cld.getAttributeDescriptorsForPath(aPath); // line > 655 > >This call return only one > >element:[EMAIL PROTECTED] > >delete=false,cascade retrieve=true,cascade store=false,is > >lazy=false,class of Items=class Test]] > >It should return three descriptors: TestSuite, TestCase and caseName. > >Method getAttributeDescriptorsForPath don't consider the "addPathClass" > that's > >way it can't return the good descriptors. > > > > > >Thanks for help > >Dariusz Kies > > > > > >--- Jakob Braeuchi <[EMAIL PROTECTED]> wrote: > > > > > >>hi dariusz, > >> > >>what is the problem with sample 3 ? can you pleas post the sql or an > >>error message ? > >> > >>jakob > >> > >>Dariusz Kies wrote: > >> > >> > >> > >>>Hi, > >>> > >>>I have a problem to query on composite pattern in OJB (db-ojb-1.0.rc1). > >>>Let's assume that I have Test composite pattern from JUnit in OJB: > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>>1. This works ok: > >>>Criteria crit = new Criteria(); > >>>crit.addEqualTo("test.caseName", "test 1"); > >>>Query query = QueryFactory.newQuery(Foo.class, crit); > >>>query.addPathClass("test", TestCase.class); > >>>Collection results = broker.getCollectionByQuery(query); > >>> > >>> > >>>2. This don't work: > >>>Criteria crit = new Criteria(); > >>>crit.addEqualTo("test.test.caseName", "test 2"); > >>>Query query = QueryFactory.newQuery(Foo.class, crit); > >>>query.addPathClass("test", TestSuite.class); // first test > >>>query.addPathClass("test", TestCase.class); // second test > >>>Collection results = broker.getCollectionByQuery(query); > >>> > >>> > >>>3. Still doesn't work: > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>> > >>>Criteria crit = new Criteria(); > >>>crit.addEqualTo("aTest.test.caseName", "test 3"); > >>>Query query = QueryFactory.newQuery(Foo.class, crit); > >>>query.addPathClass("aTest", TestSuite.class); > >>>query.addPathClass("test", TestCase.class); > >>>Collection results = broker.getCollectionByQuery(query); > >>> > >>> > >>>Can I query on composite pattern in OJB? > >>> > >>> > >>>Thanks for help > >>>Dariusz Kies > >>> > >>> > >>>__ > >>>Do you Yahoo!? > >>>Yahoo! Web Hosting - establish your business online > >>>http://webhosting.yahoo.com > >>> > >>>- > >>>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >>> > >>> > >>> > >>> > >>> > >>- > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > >__ > >Do you Yahoo!? > >Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! > >http://platinum.yahoo.com > > > >- > >To unsubscribe, e-mail: [EMAIL PROTECTED] > >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _
0.9.8 -> 1.0 upgrade issue - Instantiating of current set RowReaderfailed
This exception is occurring on a PersistenceBrokerFactory.defaultPersistenceBroker() Has there been some change to the way the default row-reader should be specified? It looks like there is no matching constructor wherever the default RowReader one is supposed to be. Useful bits of the stack trace follow: Could not read repository class descriptor data, using repository: repository.xml: Instantiating of current set RowReader failed java.lang.NoSuchMethodException at java.lang.Class.getConstructor0(Class.java:1755) at java.lang.Class.getConstructor(Class.java:990) at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source) at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source) at org.apache.ojb.broker.util.ClassHelper.newInstance(Unknown Source) at org.apache.ojb.broker.metadata.ClassDescriptor.setRowReader(Unknown Source) at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(Unknown Source) rethrown as org.apache.ojb.broker.metadata.MetadataException: Instantiating of current set RowReader failed at org.apache.ojb.broker.metadata.ClassDescriptor.setRowReader(Unknown Source) at org.apache.ojb.broker.metadata.RepositoryXmlHandler.startElement(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:454) -- --- Gareth Cronin Analyst/Programmer Kiwiplan NZ Ltd www.kiwiplan.com Ph 2727622 x854 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Curious: OQL - select * no longer works
Hi I have noticed that queries with select * do not seem to work in 1.0 but worked in 0.9.8. Was using select * invalid to start with? Thanks Shane Shane Mingins Analyst Programmer Assure NZ Ltd Ph 644 494 2522
RE: performance
I would love to. Unfortunately the system architect for this project refuses to budge on these types of issues. Phase one of this project has been in production for just about a year (plus a lot of imported data) and there are exactly zero occurences where a person is mapped to more than one company in the system, but he refuses to concede this point. Thats where my frustration is and sorry if it came across as frustration towards anyone on this list. But if a hear the word "flexible" one more time in relation to DB schema design I am going to scream ;-) At any rate, no it is not possible to merge this data. The thing that confuses me is that running this in sqlplus (manually opening a cursor over the 1524 employee records and iterating over them in a loop while loading there associated person record inside the loop) takes no time at all (like .4 seconds). Of course that all happens server-side. So to try to add more load, I added output statements inside the loop (which Oracle can't handle really well), but the looping still just took around 4 seconds. I have been pushing OJB over our current O/R tool (Castor) for the last year, and have finally gotten the go ahead to migrate to something other than Castor. But it will be hard to justify when loading (what seems like) simple object graphs takes this long. I'll have a further look at the RowReader usage to see how it might best be used. -Original Message- From: Matthew Baird [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 3:52 PM To: OJB Users List Subject: RE: performance I can sense your frustration that your question was not answered in the time frame you had hoped. the answer would be "no" this is neither normal or acceptable. I believe there was some work done to support subclassing across tables, and I will look into that. You could use a "fast" mapping that just brings the name into the object world vs a big complex object. A custom rowreader could probably also do this. there is no way you can put both the person and contact mapped to one table? I know that works nicely and is quick. cheers, Matthew -Original Message- From: Ebersole, Steven [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 10:52 AM To: 'OJB Users List' Subject: RE: performance So would over 2 minutes be considered acceptable/normal for OJB then? |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 10:28 AM |To: 'OJB Users List' |Subject: RE: performance | | |I did I little more troubleshooting (hacking) and found |that, at least in |part, the problem is caused by the Contact's reference to |the Person class |and Company class. If I proxy those references or remove |them, the load |time goes from 2 minutes 5 seconds down to 30 seconds for |the company with |1524 employees. | |The problem with proxying the Person reference is that |there is never a time |when I would need the Contact without their name, which is |kept on the |PERSON table mapping to the Person class. | |Basically the concept I am trying to model here is a |person's relationship |to a company. Ideally, the Contact class would simply be |a sub-class of |Person with the company relation information on that |Contact concrete |subclass. Yet from what I have read OJB does not support |subclassing across |tables, aside from indirectly as I have modeled it. Is |there a better way |to map this relationship using OJB? Or maybe a way to |force OJB to perform |an outer join here since it is a single association going |from the Contact |to the Person? Maybe a custom RowReader impl? | |I also verified (as I think Cristian was trying to imply) |that the queries |themselves are pretty quick, at least through Oracle's sqlplus. | | |Anyway, any help would be great. | | | |-Original Message- |From: Malinescu, Cristian [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 8:43 AM |To: 'OJB Users List' |Subject: RE: performance | | |Hi, surprising how much similarity, we are doing also some CRM |and we used some commercial appsrv( like "t3://myserver:7001" ;-) ) |till we become very piss off because of entity ejb performance |and now we will migrate to tomcat and ojb ( currently |4.1.18/1.0rc1 ) |and our performance test are till now very satisfactory ... |Regards, |Cristian | |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Dienstag, 18. März 2003 15:30 |To: 'OJB Users List' |Subject: RE: performance | | |Thanks for the response. | |First the database schema is completely normalized. And |unfortunately I |cant work with just 15 tables; this is the beginin
RE: performance
I can sense your frustration that your question was not answered in the time frame you had hoped. the answer would be "no" this is neither normal or acceptable. I believe there was some work done to support subclassing across tables, and I will look into that. You could use a "fast" mapping that just brings the name into the object world vs a big complex object. A custom rowreader could probably also do this. there is no way you can put both the person and contact mapped to one table? I know that works nicely and is quick. cheers, Matthew -Original Message- From: Ebersole, Steven [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 10:52 AM To: 'OJB Users List' Subject: RE: performance So would over 2 minutes be considered acceptable/normal for OJB then? |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 10:28 AM |To: 'OJB Users List' |Subject: RE: performance | | |I did I little more troubleshooting (hacking) and found |that, at least in |part, the problem is caused by the Contact's reference to |the Person class |and Company class. If I proxy those references or remove |them, the load |time goes from 2 minutes 5 seconds down to 30 seconds for |the company with |1524 employees. | |The problem with proxying the Person reference is that |there is never a time |when I would need the Contact without their name, which is |kept on the |PERSON table mapping to the Person class. | |Basically the concept I am trying to model here is a |person's relationship |to a company. Ideally, the Contact class would simply be |a sub-class of |Person with the company relation information on that |Contact concrete |subclass. Yet from what I have read OJB does not support |subclassing across |tables, aside from indirectly as I have modeled it. Is |there a better way |to map this relationship using OJB? Or maybe a way to |force OJB to perform |an outer join here since it is a single association going |from the Contact |to the Person? Maybe a custom RowReader impl? | |I also verified (as I think Cristian was trying to imply) |that the queries |themselves are pretty quick, at least through Oracle's sqlplus. | | |Anyway, any help would be great. | | | |-Original Message- |From: Malinescu, Cristian [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 8:43 AM |To: 'OJB Users List' |Subject: RE: performance | | |Hi, surprising how much similarity, we are doing also some CRM |and we used some commercial appsrv( like "t3://myserver:7001" ;-) ) |till we become very piss off because of entity ejb performance |and now we will migrate to tomcat and ojb ( currently |4.1.18/1.0rc1 ) |and our performance test are till now very satisfactory ... |Regards, |Cristian | |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Dienstag, 18. März 2003 15:30 |To: 'OJB Users List' |Subject: RE: performance | | |Thanks for the response. | |First the database schema is completely normalized. And |unfortunately I |cant work with just 15 tables; this is the begining of a |CRM app and phase |one alone has over 300 tables. All PK and FK are also set |up as indexes. |Not that it (should) matter much, but we also use Oracle 8i. | |As for the source code, this is just a simple test class |(code below) and as |such, there is only one PB instance. This is not yet even |incurring the |overhead of the EJB calls. | | |public class TestCompanyMappings |{ |private static final Logger log = Logger.getRootLogger(); | |public TestCompanyMappings() |{ |System.setProperty( "OJB.properties", |"properties/OJB.properties" |); |System.setProperty( Context.PROVIDER_URL, |"t3://myserver:7001" ); |System.setProperty( Context.INITIAL_CONTEXT_FACTORY, |"weblogic.jndi.WLInitialContextFactory" ); |} | |public static void main( String[] args ) |{ |TestCompanyMappings me = new TestCompanyMappings(); |me.execute(); |} | |private void execute() |{ |PersistenceBroker broker = null; |Criteria crit = null; |crit = new Criteria(); |crit.addEqualTo( "id", new Integer(1) ); |Query query = new QueryByCriteria( Company.class, crit ); | |try |{ |broker = |PersistenceBrokerFactory.defaultPersistenceBroker(); |log.debug( "Starting query" ); |java.util.Collection extent = |broker.getCollecti
Fw: is it possible? - same class mapped to different tables
I am asking this question again, as I did not get any response. I have OJB deployed in a .sar file under JBOSS. I have more than one application sharing a common persistent class that I would like to map to different database tables. I do not see how that is possible with the current OJB repository.xml set-up. Any ideas on how to accomplish this will be immensely appreciated. Rajeev - Original Message - From: "Rajeev Kaul" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 10:57 AM Subject: is it possible? - same class mapped to different tables Is it possible to have a common class shared between different web applications mapped to different tables? If so, please show how to define the metadata for this case in a repository.xml file. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
m:n Question
I've got an m:n association that's causing me a problem. Let's say I have two Java classes, A and B, that have underlying database tables and an m:n association between them. Both A and B have members of type java.util.Collection that maintain references to the other. I have a constructor for A that allows me to create an empty collection of B references. When I test creating and storing an instance of class A with an empty collection of B references OJB throws a java.util.NoSuchElementException: "Thrown by the nextElement method of an Enumeration to indicate that there are no more elements in the enumeration." Does OJB not allow me to persist an instance of class A which has no references to class B, or have I made another newbie mistake? Thank you. - MOD __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: OJB criteria fails with Oracle char field right filled with spaces
Max, Thanks for your recommendation. Sometimes, database design is a fixed variable, therefore you cannot alter database design (this database is actually in use from some other apps). It seems that Jakob´s tips is the right path (hope it works even when changing back-end RDBMS ). Again, thank you very much. Gustavo. "Geigl Maximilian,To: "OJB Users List" <[EMAIL PROTECTED]> R235" cc: with spaces 19/03/2003 14:20 Please respond to "OJB Users List" Hi, we switched to VARCHAR2 (instead of CHAR) for the same reason; maybe more convenient than using trim() all the time. Regards Max > -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 19. März 2003 16:56 > An: 'OJB Users List' > Betreff: OJB criteria fails with Oracle char field right filled with > spaces > > > Hi all, > > We are using OJB, Oracle 9i. When trying to retrieve an > object by criteria, > OJB is not finding the requested object since the CHAR fields > are right > filled with spaces. > > Just an example: > > oracle table emp > field name: FIRST_NAME(CHAR10) > > object Emp, attribute firstName > > Object/Record to to retrieve should have firstName = Gustavo (this was > stored using OJB; Oracle fills with spaces to the right of the user > inserted string in a CHAR field) > > This will work: OJB will return the object if criteria sets > emp.firstName > to "Gustavo " (note the 3 spaces at the right): > Criteria mycrit = new Criteria(); > mycrit.addEqualTo("firstName", "Gustavo "); > Query myquery = new QueryByCriteria(emp.class, mycrit); > myemp= (Emp)broker.getObjectByQuery(myquery); > > This will not work: OJB will fail to return the object if > criteria is set > to emp.firstName = "Gustavo" (no spaces). > Criteria mycrit = new Criteria(); > mycrit.addEqualTo("firstName", "Gustavo"); > Query myquery = new QueryByCriteria(emp.class, mycrit); > myemp= (Emp)broker.getObjectByQuery(myquery); > > Problem here is that the java coder has to know the database > field lenght > in order to fill the string with the right number of spaces. It´s our > understanding that OJB should take care of the the > object.attribute ==> > RDBMS mapping without requiring the programmer to take care > of things like > this. > > We´ve tested setting criteria to SQL string and it works, but > again, this > approach requires us to "wire" some database specific > things like field > names to our java code. > > Criteria mycrit = new Criteria(); > crit.addSql("FIRST_NAME = 'Gustavo'"); > Query query = new QueryByCriteria(Usuario.class, crit); > myemp = (Emp) broker.getObjectByQuery(query); > > Are we missing something here? Any ideas? > > Thanks in advance > > Gustavo Faerman > Buenos Aires, > Argentina. > > > - > 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
So would over 2 minutes be considered acceptable/normal for OJB then? |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 10:28 AM |To: 'OJB Users List' |Subject: RE: performance | | |I did I little more troubleshooting (hacking) and found |that, at least in |part, the problem is caused by the Contact's reference to |the Person class |and Company class. If I proxy those references or remove |them, the load |time goes from 2 minutes 5 seconds down to 30 seconds for |the company with |1524 employees. | |The problem with proxying the Person reference is that |there is never a time |when I would need the Contact without their name, which is |kept on the |PERSON table mapping to the Person class. | |Basically the concept I am trying to model here is a |person's relationship |to a company. Ideally, the Contact class would simply be |a sub-class of |Person with the company relation information on that |Contact concrete |subclass. Yet from what I have read OJB does not support |subclassing across |tables, aside from indirectly as I have modeled it. Is |there a better way |to map this relationship using OJB? Or maybe a way to |force OJB to perform |an outer join here since it is a single association going |from the Contact |to the Person? Maybe a custom RowReader impl? | |I also verified (as I think Cristian was trying to imply) |that the queries |themselves are pretty quick, at least through Oracle's sqlplus. | | |Anyway, any help would be great. | | | |-Original Message- |From: Malinescu, Cristian [mailto:[EMAIL PROTECTED] |Sent: Tuesday, March 18, 2003 8:43 AM |To: 'OJB Users List' |Subject: RE: performance | | |Hi, surprising how much similarity, we are doing also some CRM |and we used some commercial appsrv( like "t3://myserver:7001" ;-) ) |till we become very piss off because of entity ejb performance |and now we will migrate to tomcat and ojb ( currently |4.1.18/1.0rc1 ) |and our performance test are till now very satisfactory ... |Regards, |Cristian | |-Original Message- |From: Ebersole, Steven [mailto:[EMAIL PROTECTED] |Sent: Dienstag, 18. März 2003 15:30 |To: 'OJB Users List' |Subject: RE: performance | | |Thanks for the response. | |First the database schema is completely normalized. And |unfortunately I |cant work with just 15 tables; this is the begining of a |CRM app and phase |one alone has over 300 tables. All PK and FK are also set |up as indexes. |Not that it (should) matter much, but we also use Oracle 8i. | |As for the source code, this is just a simple test class |(code below) and as |such, there is only one PB instance. This is not yet even |incurring the |overhead of the EJB calls. | | |public class TestCompanyMappings |{ |private static final Logger log = Logger.getRootLogger(); | |public TestCompanyMappings() |{ |System.setProperty( "OJB.properties", |"properties/OJB.properties" |); |System.setProperty( Context.PROVIDER_URL, |"t3://myserver:7001" ); |System.setProperty( Context.INITIAL_CONTEXT_FACTORY, |"weblogic.jndi.WLInitialContextFactory" ); |} | |public static void main( String[] args ) |{ |TestCompanyMappings me = new TestCompanyMappings(); |me.execute(); |} | |private void execute() |{ |PersistenceBroker broker = null; |Criteria crit = null; |crit = new Criteria(); |crit.addEqualTo( "id", new Integer(1) ); |Query query = new QueryByCriteria( Company.class, crit ); | |try |{ |broker = |PersistenceBrokerFactory.defaultPersistenceBroker(); |log.debug( "Starting query" ); |java.util.Collection extent = |broker.getCollectionByQuery( query |); |log.debug( "Done query; iterating" ); |java.util.Iterator iter = extent.iterator(); |while (iter.hasNext()) |{ |display( (Company)iter.next() ); |} |log.debug( "Done iterating" ); |} |catch( Throwable t ) |{ |log.error( "Error occurred", t ); |} |finally |{ |if (broker != null) |{ |try |{ |broker.close(); |} |catch( Throwable t ) |{
Anyone Using JCS Cache?
We are currently using OJB with our project and are researching the JCS caching module. I was curious if anyone is using it. If so: What lead you to use JCS versus some other caching option? Any general impressions about how using the JCS cache effects OJB (speed wise, bug wise, etc)? Has anyone used the distributed caching option of JCS in conjunction with OJB? Scott Delap Demand Management, Inc. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: OJB criteria fails with Oracle char field right filled with spaces
Hi, we switched to VARCHAR2 (instead of CHAR) for the same reason; maybe more convenient than using trim() all the time. Regards Max > -Ursprüngliche Nachricht- > Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Gesendet: Mittwoch, 19. März 2003 16:56 > An: 'OJB Users List' > Betreff: OJB criteria fails with Oracle char field right filled with > spaces > > > Hi all, > > We are using OJB, Oracle 9i. When trying to retrieve an > object by criteria, > OJB is not finding the requested object since the CHAR fields > are right > filled with spaces. > > Just an example: > > oracle table emp > field name: FIRST_NAME(CHAR10) > > object Emp, attribute firstName > > Object/Record to to retrieve should have firstName = Gustavo (this was > stored using OJB; Oracle fills with spaces to the right of the user > inserted string in a CHAR field) > > This will work: OJB will return the object if criteria sets > emp.firstName > to "Gustavo " (note the 3 spaces at the right): > Criteria mycrit = new Criteria(); > mycrit.addEqualTo("firstName", "Gustavo "); > Query myquery = new QueryByCriteria(emp.class, mycrit); > myemp= (Emp)broker.getObjectByQuery(myquery); > > This will not work: OJB will fail to return the object if > criteria is set > to emp.firstName = "Gustavo" (no spaces). > Criteria mycrit = new Criteria(); > mycrit.addEqualTo("firstName", "Gustavo"); > Query myquery = new QueryByCriteria(emp.class, mycrit); > myemp= (Emp)broker.getObjectByQuery(myquery); > > Problem here is that the java coder has to know the database > field lenght > in order to fill the string with the right number of spaces. It´s our > understanding that OJB should take care of the the > object.attribute ==> > RDBMS mapping without requiring the programmer to take care > of things like > this. > > We´ve tested setting criteria to SQL string and it works, but > again, this > approach requires us to "wire" some database specific > things like field > names to our java code. > > Criteria mycrit = new Criteria(); > crit.addSql("FIRST_NAME = 'Gustavo'"); > Query query = new QueryByCriteria(Usuario.class, crit); > myemp = (Emp) broker.getObjectByQuery(query); > > Are we missing something here? Any ideas? > > Thanks in advance > > Gustavo Faerman > Buenos Aires, > Argentina. > > > - > 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: Query on composite pattern
hi dariusz, i'm thinking of the following solution to this problem: a.) pass the hints to getAttributeDescriptorsForPath b.) in getAttributeDescriptorsForPath i'd like to scan the extents if a descriptor can't be found in the class. what do you think ? jakob Dariusz Kies wrote: Hi, Here is the sql for 3: [org.apache.ojb.broker.accesslayer.sql.SqlGeneratorDefaultImpl] DEBUG: SQL: SELECT A0.ID,A0.ID_TEST FROM FI.T_FOO A0,FI.T_TEST_SUITE A1 WHERE A0.ID_TEST=A1.ID AND (caseName = ? ) Notice that there isn't the column name for the caseName attribute and there isn't join with FI.T_TEST_CASE. I debug a little and I found that a problem is in the class org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement, method getTableAlias and call descriptors = getRoot().cld.getAttributeDescriptorsForPath(aPath); // line 655 This call return only one element:[EMAIL PROTECTED] delete=false,cascade retrieve=true,cascade store=false,is lazy=false,class of Items=class Test]] It should return three descriptors: TestSuite, TestCase and caseName. Method getAttributeDescriptorsForPath don't consider the "addPathClass" that's way it can't return the good descriptors. Thanks for help Dariusz Kies --- Jakob Braeuchi <[EMAIL PROTECTED]> wrote: hi dariusz, what is the problem with sample 3 ? can you pleas post the sql or an error message ? jakob Dariusz Kies wrote: Hi, I have a problem to query on composite pattern in OJB (db-ojb-1.0.rc1). Let's assume that I have Test composite pattern from JUnit in OJB: 1. This works ok: Criteria crit = new Criteria(); crit.addEqualTo("test.caseName", "test 1"); Query query = QueryFactory.newQuery(Foo.class, crit); query.addPathClass("test", TestCase.class); Collection results = broker.getCollectionByQuery(query); 2. This don't work: Criteria crit = new Criteria(); crit.addEqualTo("test.test.caseName", "test 2"); Query query = QueryFactory.newQuery(Foo.class, crit); query.addPathClass("test", TestSuite.class); // first test query.addPathClass("test", TestCase.class); // second test Collection results = broker.getCollectionByQuery(query); 3. Still doesn't work: Criteria crit = new Criteria(); crit.addEqualTo("aTest.test.caseName", "test 3"); Query query = QueryFactory.newQuery(Foo.class, crit); query.addPathClass("aTest", TestSuite.class); query.addPathClass("test", TestCase.class); Collection results = broker.getCollectionByQuery(query); Can I query on composite pattern in OJB? Thanks for help Dariusz Kies __ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB criteria fails with Oracle char field right filled with spaces
Hi Jakob, Thank you very much for your help. It worked. I did not know I could use trim right there. Any pointer to the OBJ documentation where I can read more about this? Best Regards, Gustavo. Jakob Braeuchi <[EMAIL PROTECTED] To: OJB Users List <[EMAIL PROTECTED]> .ch> cc: Subject: Re: OJB criteria fails with Oracle char field right filled 19/03/2003with spaces 13:30 Please respond to "OJB Users List" hi gustavo, why can't you use trim or an equivalent oracle-function to get rid of the spaces ? mycrit.addEqualTo("trim(firstName)", "Gustavo"); hth jakob [EMAIL PROTECTED] wrote: >Hi all, > >We are using OJB, Oracle 9i. When trying to retrieve an object by criteria, >OJB is not finding the requested object since the CHAR fields are right >filled with spaces. > >Just an example: > >oracle table emp >field name: FIRST_NAME(CHAR10) > >object Emp, attribute firstName > >Object/Record to to retrieve should have firstName = Gustavo (this was >stored using OJB; Oracle fills with spaces to the right of the user >inserted string in a CHAR field) > >This will work: OJB will return the object if criteria sets emp.firstName >to "Gustavo " (note the 3 spaces at the right): >Criteria mycrit = new Criteria(); >mycrit.addEqualTo("firstName", "Gustavo "); >Query myquery = new QueryByCriteria(emp.class, mycrit); >myemp= (Emp)broker.getObjectByQuery(myquery); > >This will not work: OJB will fail to return the object if criteria is set >to emp.firstName = "Gustavo" (no spaces). >Criteria mycrit = new Criteria(); >mycrit.addEqualTo("firstName", "Gustavo"); >Query myquery = new QueryByCriteria(emp.class, mycrit); >myemp= (Emp)broker.getObjectByQuery(myquery); > >Problem here is that the java coder has to know the database field lenght >in order to fill the string with the right number of spaces. It´s our >understanding that OJB should take care of the the object.attribute ==> >RDBMS mapping without requiring the programmer to take care of things like >this. > >We´ve tested setting criteria to SQL string and it works, but again, this >approach requires us to "wire" some database specific things like field >names to our java code. > >Criteria mycrit = new Criteria(); >crit.addSql("FIRST_NAME = 'Gustavo'"); >Query query = new QueryByCriteria(Usuario.class, crit); >myemp = (Emp) broker.getObjectByQuery(query); > >Are we missing something here? Any ideas? > >Thanks in advance > >Gustavo Faerman >Buenos Aires, >Argentina. > > >- >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: OJB criteria fails with Oracle char field right filled with spaces
hi gustavo, why can't you use trim or an equivalent oracle-function to get rid of the spaces ? mycrit.addEqualTo("trim(firstName)", "Gustavo"); hth jakob [EMAIL PROTECTED] wrote: Hi all, We are using OJB, Oracle 9i. When trying to retrieve an object by criteria, OJB is not finding the requested object since the CHAR fields are right filled with spaces. Just an example: oracle table emp field name: FIRST_NAME(CHAR10) object Emp, attribute firstName Object/Record to to retrieve should have firstName = Gustavo (this was stored using OJB; Oracle fills with spaces to the right of the user inserted string in a CHAR field) This will work: OJB will return the object if criteria sets emp.firstName to "Gustavo " (note the 3 spaces at the right): Criteria mycrit = new Criteria(); mycrit.addEqualTo("firstName", "Gustavo "); Query myquery = new QueryByCriteria(emp.class, mycrit); myemp= (Emp)broker.getObjectByQuery(myquery); This will not work: OJB will fail to return the object if criteria is set to emp.firstName = "Gustavo" (no spaces). Criteria mycrit = new Criteria(); mycrit.addEqualTo("firstName", "Gustavo"); Query myquery = new QueryByCriteria(emp.class, mycrit); myemp= (Emp)broker.getObjectByQuery(myquery); Problem here is that the java coder has to know the database field lenght in order to fill the string with the right number of spaces. It´s our understanding that OJB should take care of the the object.attribute ==> RDBMS mapping without requiring the programmer to take care of things like this. We´ve tested setting criteria to SQL string and it works, but again, this approach requires us to "wire" some database specific things like field names to our java code. Criteria mycrit = new Criteria(); crit.addSql("FIRST_NAME = 'Gustavo'"); Query query = new QueryByCriteria(Usuario.class, crit); myemp = (Emp) broker.getObjectByQuery(query); Are we missing something here? Any ideas? Thanks in advance Gustavo Faerman Buenos Aires, Argentina. - 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: addGreaterOrEqual
hi ismail, please post the sql. jakob Ismail Siddiqui wrote: Hey can some one tell me what is wrong with the following c.addGreaterOrEqualThan("initial_limit",new Integer(score)); c.addLessOrEqualThan("final_limit",new Integer(score)); QueryByCriteria query = new QueryByCriteria(Quizscore.class, c); Quizscore q = (Quizscore)broker.getObjectByQuery(query); broker.commitTransaction(); return q; its returning me a null object although I know the score I am passing exists in valid range. - 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]
OJB criteria fails with Oracle char field right filled with spaces
Hi all, We are using OJB, Oracle 9i. When trying to retrieve an object by criteria, OJB is not finding the requested object since the CHAR fields are right filled with spaces. Just an example: oracle table emp field name: FIRST_NAME(CHAR10) object Emp, attribute firstName Object/Record to to retrieve should have firstName = Gustavo (this was stored using OJB; Oracle fills with spaces to the right of the user inserted string in a CHAR field) This will work: OJB will return the object if criteria sets emp.firstName to "Gustavo " (note the 3 spaces at the right): Criteria mycrit = new Criteria(); mycrit.addEqualTo("firstName", "Gustavo "); Query myquery = new QueryByCriteria(emp.class, mycrit); myemp= (Emp)broker.getObjectByQuery(myquery); This will not work: OJB will fail to return the object if criteria is set to emp.firstName = "Gustavo" (no spaces). Criteria mycrit = new Criteria(); mycrit.addEqualTo("firstName", "Gustavo"); Query myquery = new QueryByCriteria(emp.class, mycrit); myemp= (Emp)broker.getObjectByQuery(myquery); Problem here is that the java coder has to know the database field lenght in order to fill the string with the right number of spaces. It´s our understanding that OJB should take care of the the object.attribute ==> RDBMS mapping without requiring the programmer to take care of things like this. We´ve tested setting criteria to SQL string and it works, but again, this approach requires us to "wire" some database specific things like field names to our java code. Criteria mycrit = new Criteria(); crit.addSql("FIRST_NAME = 'Gustavo'"); Query query = new QueryByCriteria(Usuario.class, crit); myemp = (Emp) broker.getObjectByQuery(query); Are we missing something here? Any ideas? Thanks in advance Gustavo Faerman Buenos Aires, Argentina. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to send a real SQL query to OJB
Hi Sylvain, see FAQ http://db.apache.org/ojb/faq.html topic "Is it possible to perform my own sql-queries in OJB?" + "Can I directly obtain a java.sql.Connection within OJB?" regards, Armin - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, March 19, 2003 4:05 PM Subject: how to send a real SQL query to OJB Hello, I have a String variable which contains a real SQL query like this: "SELECT distinct(workstationName) FROM Workstation w, WntWorkstation t, Package p, Package_Workstation r WHERE (w.workstationName like '%' or w.workstationName is NULL) order by w.workstationName" How can I send this query (as written above) to OJB? Thanks Sylvain - 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]
how to send a real SQL query to OJB
Hello, I have a String variable which contains a real SQL query like this: "SELECT distinct(workstationName) FROM Workstation w, WntWorkstation t, Package p, Package_Workstation r WHERE (w.workstationName like '%' or w.workstationName is NULL) order by w.workstationName" How can I send this query (as written above) to OJB? Thanks Sylvain - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with the cache on OJB
It works. Thank you very much for your quick answer. -Message d'origine- De : Lance Eason [mailto:[EMAIL PROTECTED] Envoyé : mercredi 19 mars 2003 15:34 À : OJB Users List; [EMAIL PROTECTED] Objet : RE: Problem with the cache on OJB PersistenceBroker.clearCache() -Original Message- From: Hennebelle [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 8:30 AM To: [EMAIL PROTECTED] Subject: Problem with the cache on OJB Hello, I've got a problem with OJB's cache. In my program, I make two requests in SQL. I retrieve the two requests in the spy.log : select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'V' select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'E' The beans I retrieve are exactly the same (they have the same 'etat' which is 'V' in my example). My question is that I want to empty the cache between the calls of the two requests. How can I do this ? PS : I don't want to change 'ObjectCacheDefaultImpl' by 'ObjectCacheEmptyImpl' in my OJB.properties for the Object cache because I will have many problems with it for making joints. In fact, when I use this class, my problem is solved but I've got my joint which take a lot of time (it jumps from 0.8 sec to 6 sec), that's why I want to do this in my program. Olivier Hennebelle 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: Problem with the cache on OJB
PersistenceBroker.clearCache() -Original Message- From: Hennebelle [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 8:30 AM To: [EMAIL PROTECTED] Subject: Problem with the cache on OJB Hello, I've got a problem with OJB's cache. In my program, I make two requests in SQL. I retrieve the two requests in the spy.log : select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'V' select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'E' The beans I retrieve are exactly the same (they have the same 'etat' which is 'V' in my example). My question is that I want to empty the cache between the calls of the two requests. How can I do this ? PS : I don't want to change 'ObjectCacheDefaultImpl' by 'ObjectCacheEmptyImpl' in my OJB.properties for the Object cache because I will have many problems with it for making joints. In fact, when I use this class, my problem is solved but I've got my joint which take a lot of time (it jumps from 0.8 sec to 6 sec), that's why I want to do this in my program. Olivier Hennebelle mail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with the cache on OJB
Hello, I've got a problem with OJB's cache. In my program, I make two requests in SQL. I retrieve the two requests in the spy.log : select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'V' select A.* from A, B WHERE A.column = B.COLUMN and A.etat = 'E' The beans I retrieve are exactly the same (they have the same 'etat' which is 'V' in my example). My question is that I want to empty the cache between the calls of the two requests. How can I do this ? PS : I don't want to change 'ObjectCacheDefaultImpl' by 'ObjectCacheEmptyImpl' in my OJB.properties for the Object cache because I will have many problems with it for making joints. In fact, when I use this class, my problem is solved but I've got my joint which take a lot of time (it jumps from 0.8 sec to 6 sec), that's why I want to do this in my program. Olivier Hennebelle mail : [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Persistence brokers and threads..(again)
Hi I asked this question a couple of days ago. Up to now I have been managing my own persistence broker/thread mapping; I noticed that there is a persitence broker thread mapping class in the distribution for RC1. >From looking at the code I cant see how the roker/thread mapping works as the only reference to a persistence broker thread mapping is in PersistenceBrokerThreadMapping class, which is used in the PersistenceBrokerFactoryDefaultImpl class but only in the methods activateObject/passivateObject which is not called in any other code in the distribution. Questions are: - am I mistaken... - if so, does this all happen by default - or, should I still perform my own thread/broker management. Regards Mark Rowell Mark Rowell CreditTrade T: +44 (020) 7400 5078 M: mailto:[EMAIL PROTECTED] CreditTrade Limited is regulated by the FSA. (c) CreditTrade 2002. All rights reserved. The information and data contained in this email is provided for the information purposes of the addressee only and should not be reproduced and/or distributed to any other person. It is provided without any warranty whatsoever and unless stated otherwise consists purely of indicative market prices and other information. Any opinion or comments expressed or assumption made in association with the data or information provided in this email is a reflection of CreditTrades judgement at the time of compiling the data and is subject to change. CreditTrade hereby makes no representation and accepts no responsibility or liability as to the completeness or accuracy of this email. The content of this email is not intended as an offer or solicitation for, or recommendation of, the purchase or sale of any financial instrument, or as an official confirmation of any transaction, and should not be construed as investment advice. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Transactions with MySQL using non-transaction-capable tables
Hi Joerg, OJB relies on the transaction capabilities provided by the JDBC backend. But as there are several DBMS that do not provide proper transaction handling (like MS Access) OJB works around those limitations. But it does simply drop transactional processing in those cases and does not provide it's own tx processor! so, if you want transactions use transaction enbabled tables! cheers, Thomas > -Original Message- > From: Joerg Lensing [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 11:14 AM > To: OJB Users List > Subject: Transactions with MySQL using non-transaction-capable tables > > > Hi > does OJB manage transaction itself or is the transaction-layer from > mysql (i.e. mysql innodb-tables) used? > > joerg > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to use Transactions using ODMB but no OQL (PB instead)
Have a look at the FAQ, Section "I don't like OQL, can I use the PersistenceBroker Queries within ODMG?" code snippet is provided! > -Original Message- > From: Joerg Lensing [mailto:[EMAIL PROTECTED] > Sent: Wednesday, March 19, 2003 11:02 AM > To: OJB Users List > Subject: How to use Transactions using ODMB but no OQL (PB instead) > > > hi, > i want to use the transactioncapabilities from odmg, but > queries should > be constructed with the PersistenceBroker > (easier to use - better performance). How can i do this? > short examples welcome > > joerg > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I cannot get the ODMG API working
Hello, > -Original Message- > > And it stumped me for a day. It would help us newbies if the > documentation > and tutorials were a little more specific (and emphatic) > about this point. I agree. There were several threads in which people complained about this. Olli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Transactions with MySQL using non-transaction-capable tables
Hi does OJB manage transaction itself or is the transaction-layer from mysql (i.e. mysql innodb-tables) used? joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to use Transactions using ODMB but no OQL (PB instead)
FAQ : See http://db.apache.org/ojb/faq.htm, section entitled "I don't like OQL, can I use the PersistenceBroker Queries within ODMG? " >-Original Message- >From: Joerg Lensing [mailto:[EMAIL PROTECTED] >Sent: 19 March 2003 10:02 >To: OJB Users List >Subject: How to use Transactions using ODMB but no OQL (PB instead) > > >hi, >i want to use the transactioncapabilities from odmg, but >queries should >be constructed with the PersistenceBroker >(easier to use - better performance). How can i do this? >short examples welcome > >joerg > > > >- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use Transactions using ODMB but no OQL (PB instead)
hi, i want to use the transactioncapabilities from odmg, but queries should be constructed with the PersistenceBroker (easier to use - better performance). How can i do this? short examples welcome joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [jBoss deployment && re-deployment!]: example ejb beans not deploying
Hi Phil, you are right. This are two important points and I will add your comments to deployment doc. regards, Armin - Original Message - From: "Phil Warrick" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Wednesday, March 19, 2003 4:22 AM Subject: Re: [jBoss deployment && re-deployment!]: example ejb beans not deploying > Hi Armin, > > Great, I am also able to redeploy. As for the docs, The only things > that I see now that might be non-obvious for someone trying the ejb > beans for the first time are > > 1) How to deploy ojb test hsqldb database to jboss > After creating the database with > bin\build prepare-testdb > > Take the generated OJB.script file from .../target/test > and rename the file to default.script. > Replace the jboss default.script file in > ...\jboss-3.x.y\server\default\db\hypersonic > with this file. > > 2) How to run client org.apache.ojb.ejb.AllTests > Numerous jars are required for the client. I modified build.bat > to set this up properly and called it ".\runEJBClient.bat" > > @echo off > REM Please let JAVA_HOME point to your JDK base directory > if "%JAVA_HOME%" == "" set JAVA_HOME=C:\j2sdk1.4.1 > set JAVA=%JAVA_HOME%\bin\java > set JBOSS_HOME=D:\jboss-3.0.6 > set cp= > for %%i in (%JBOSS_HOME%\client\*.jar) do call bin\cp.bat %%i > for %%i in (dist\*.jar) do call bin\cp.bat %%i > for %%i in (lib\*.jar) do call bin\cp.bat %%i > "%JAVA%" -classpath "%CP%" org.apache.ojb.ejb.AllTests > > Phil > > Armin Waibel wrote: > > Hi Phil, > > > > I got it re-deployed on jboss!! > > Thanks for your suggestion! > > It doesn't depend on the Class-Path > > attribute but it does depend on the jars > > used by OJB. > > Put all jars OJB depend on to the > > ojb.sar directory (commons-xxx.jar + antlrxxx.jar) > > then OJB could be re-deployed without any problems. > > > > I updated deployment docs in CVS > > have a look. > > > > regards, > > Armin > > > > - Original Message - > > From: "Phil Warrick" <[EMAIL PROTECTED]> > > To: "Phil Warrick" <[EMAIL PROTECTED]> > > Cc: "OJB Users List" <[EMAIL PROTECTED]> > > Sent: Tuesday, March 18, 2003 7:57 PM > > Subject: Re: [jBoss deployment]: example ejb beans not deploying > > > > > > > >>BTW: A nice reference on deployment packaging can be found at: > >> > >> > > > > http://www.theserverside.com//resources/articles/J2EE-Deployment/article > > .html > > > >>Phil > >> > >>Phil Warrick wrote: > >> > >>>Hi Armin, > >>> > >>>The problem went away when I upgraded to jBoss-3.0.6. > >>> > >>>One that I noticed in build-xdoclet.xml (although it didn't end up > >> > > being > > > >>>the cause of the problem) is that the MANIFEST.MF classpath syntax > >> > > is > > > >>>supposed to be > >>> > >>>Class-Path: xxx.jar yyy.jar > >>> > >>>rather than > >>> > >>>classpath: xxx.jar yyy.jar > >>> > >>>To be more consistent wouldn't it be better to include all the jars > >> > > that > > > >>>the beans are dependent on, like: > >>> > >>>Class-Path: db-ojb-1.0.rc2.jar db-ojb-1.0.rc2-junit.jar > >>> > >>>as well as the libs required (like commons-lang-1.0-mod.jar etc.) in > >> > > the > > > >>>build-xdoclet.xml file. > >>> > >>>At the moment only the junit jar is listed. > >>> > >>>Thanks, > >>> > >>>Phil > >>> > >>> > >>> > >>>Armin Waibel wrote: > >>> > Hi Phil, > >>> > > >>> > I tested CVS with jboss 3.0.4 + 3.0.6 > >>> > using sapDB. > >>> > I use the same directory structure: > >>> > > >>> > ojb.sar > >>> > |---META-INF > >>> > | | > >>> > | MANIFEST.MF, jboss-service.xml > >>> > db-ojb-xxx-beans.jar > >>> > db-ojb-xxx.jar > >>> > ojb config files > >>> > > >>> > Did you use current build.xml/xdoclet-build.xml file, I made > >>> > some minor changes (as far as I know;-)) > >>> > > >>> > > >>> > regards, > >>> > Armin > >>> > > >>> > - Original Message - > >>> > From: "Phil Warrick" <[EMAIL PROTECTED]> > >>> > To: "OJB Users List" <[EMAIL PROTECTED]> > >>> > Sent: Tuesday, March 18, 2003 3:57 PM > >>> > Subject: [jBoss deployment]: example ejb beans not deploying > >>> > > >>> > > >>> > > >>> >>Hi all, > >>> >> > >>> >>It looks like Armin has done a nice job of improving the > >>> > > >>> > out-of-the-box > >>> > > >>> >>ejb deployment experience. But something about the new > >> > > arrangement, > > > >>> >>where a sar directory containing > >>> >> > >>> >>db-ojb-xxx-beans.jar > >>> >>db-ojb-xxx.jar > >>> >>ojb configuration files > >>> >>jboss META-INF descriptor files > >>> >> > >>> >>causes the beans to not see the classes within db-ojb-xxx.jar. I > >> > > get > > > >>> >>errors like NoClassDefFound for OJBRuntimeException, which is > >>> > > >>> > certainly > >>> > > >>> >>located in db-ojb-xxx.jar. The OJB services do deploy fine if I > >> > > leave > > > >>> >>out the beans jar. I noticed that the deployer is now a RAR > >> > > which > > > >>> > > >>> > might > >>> > > >>> >>influence dependencies. > >>> >> > >>> >>My environment is Win2K, jboss 3.0.4,
RE: I cannot get the ODMG API working
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: 19. marts 2003 08:07 > To: [EMAIL PROTECTED] > Subject: RE: I cannot get the ODMG API working > > > database.open("repository.xml",Database.OPEN_READ_WRITE); > > > this is a known issue. And it stumped me for a day. It would help us newbies if the documentation and tutorials were a little more specific (and emphatic) about this point. Peter