Re: junit tests failed on oracle
Hi Al, Al Thompson wrote: Hi: After some mucking around, I see that a possible cause of problems with OJB+Oracle may be related to a workaround in PlatformOracleImpl. The source comments for the method changePreparedStatementResultSetType() state: * Attempts to modify a private member in the Oracle thin driver's resultset * to allow proper setting of large binary streams. I won't classify this workaround as hideous, as I don't have a better idea at the moment. A problem stems from the fact that somehow in the 9i version of the jdbc driver, the PreparedStatement object changes from a concrete object to a dynamic proxy (as in java.lang.reflect.Proxy). It seems to be not possible to retrieve any field members, private or otherwise, from said proxy instance. I decided to change this method to a no-op in the hopes that someone in Redwood City or Bangalore got around to fixing the bug/feature that made this workaround necessary in the first place. I don't seem to be that lucky. Before I changed this method to a no-op, I got the following results from the junit tests: junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 174, Failures: 0, Errors: 3, Time elapsed: 161.508 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/atx/ws/tools/ojb/target/test/ojb/OJB.properties [junit] Tests run: 147, Failures: 1, Errors: 32, Time elapsed: 30.895 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/atx/ws/tools/ojb/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 7.972 sec Now I get: junit-no-compile-no-prepare: [junit] Running org.apache.ojb.broker.AllTests [junit] Tests run: 174, Failures: 7, Errors: 5, Time elapsed: 197.636 sec [junit] TEST org.apache.ojb.broker.AllTests FAILED [junit] Running org.apache.ojb.odmg.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/atx/ws/tools/ojb/target/test/ojb/OJB.properties [junit] Tests run: 147, Failures: 6, Errors: 35, Time elapsed: 44.308 sec [junit] TEST org.apache.ojb.odmg.AllTests FAILED [junit] Running org.apache.ojb.soda.AllTests [junit] [BOOT] INFO: OJB.properties: file:/home/atx/ws/tools/ojb/target/test/ojb/OJB.properties [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 9.559 sec does not look like a real improvement to me... IMO It's no required to pass all regression tests. You just have to know which does not properly work with Oracle and if conflicts with what you are trying to do. AFAIK you will have some trouble with large BLOBs but everything else should work pretty smooth. In short, more errors and more failures. I haven't yet begun to dig into the logs for these. Would someone give me some hints as to what this workaround is about? I did not work on the Oracle stuff myself, so I'm not a big help here... I am sure the source comments were intended to be illuminating, but for some reason I am just not grokking it this Monday. I am hoping Oracle may expose some API knobs to turn on intended functionality. If this really is a bug, I can report thru our support channels. Who knows, it may even get fixed. I have done a ton of work with proxies, but so far I am only able to resolve the interfaces the proxy implements. Any attempt to look at fields yields me a nice fat stacktrace. If anyone could point to me some clues that allow me to get at the underlying fields, I would be grateful. I will continue to pore over the logs on my end in the hopes of making life easier for some other 9i user in the future. As always, thanks for all help. I really appreciate your help! Regards, Al P.S. Can someone point me to the Turbine or OJB file that controls the Oracle personality? I would like to change the LONG RAW mapping I wrote about earlier to use BLOBs. Many Thanks! src/schema/ojbcore-schema.xml contains the turbine DDL for the OJB core tables. It's not Oracle specific, but meant to be cross-platform. you can just patch it. the file profile/oracle.profile contains all Oracle specific switches and is activated by the profile=oracle switch in build.properties. cheers, Thomas - 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 returns empty collections instead of null
Hi Tim, Tim Drury wrote: When I retrieve an object from the database via OJB which has a collection of child objects, but there are no child objects in the database, OJB fills the parent object collection reference with an empty collection instead of keeping the collection reference null. Is there a way to have OJB keep the reference null? Not with out a change to the OJB codebase. Is there a benefit to having the empty collection as opposed to a null reference? 1. It's simpler to implement this way. 2. In case you want to add elements to the collection-attribute you don't need a null pointer check. I admit: not very strong reasons. But you are the first to complain about this feature in this century ;-) cheers, thomas -tim - 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 test failures
hi andrew, i changed Identity to do a convertToSql when called with an object, no conversion takes place when called with pkValues. with this change all conversion test are passed. i have a version where conversion takes place during binding of the variables, but this version fails on the referrer test :( should we drop conversion of pk values completely ? jakob Andrew Gilbert wrote: Armin, Thank you very much for this! I will build latest and re-test soon. The bummer is, it would be a major impediment to our use of OJB if we couldn't convert on pk fields. We use a custom GUID impl for the pk in many of our BO's and tables. Not sure I fully understand yet the Identity change. Sounds like you are saying internal state was inconsistent? ## I think the made changes are correct, because the conversion was not transparent for the user of the Identity object. I suggest never use converted (java -- sql) pk fields within Identity (I don't know if code base is comply with this suggest, maybe that's the reason for the hassle). The conversion could be done when it's necessary. But nevertheless I think there is a nasty bug when using field conversion with pk fields. - 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]
nasty endless loop bug found in 0.9.9
I added this following to the validate-query of a DB connection connection-pool maxActive=5 validationQuery=select count(userID) from users/ and since the userid is not a column name, I got this: [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] INFO: Destroy object was called, try to close connection: [EMAIL PROTECTED] [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] WARN: Validation query for connection failed, discard connection. Message: ERROR: Attribute userid not found and it went on and on and on. nasty stuff. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: OJB 0.9.9 mysql: Database User password form repository not used?
Here is what I use for fetching a PersistenceBroker in my code: PersistenceBroker broker = PersistenceBrokerFactory.createPersistenceBroker(new PBKey(default,sa,)); Where sa equals a user id and is the password. Hope this info helps, Jeff On Saturday 01 March 2003 06:19 pm, you wrote: Hello List, I am using the following Connection descriptor: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=MySQL jdbc-level=2.0 driver=org.gjt.mm.mysql.Driver protocol=jdbc subprotocol=mysql dbalias=//localhost:3306/fldb?autoReconnect=true username=root password=x batch-mode=false When creating a Persistence Broker, I am reciving the follwoing Exception : General error: Access denied for user: '@localhost' to database 'fldb' java.sql.SQLException: General error: Access denied for user: '@localhost' to database 'fldb' at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:264) at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89) at org.gjt.mm.mysql.Driver.connect(Driver.java:167) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:193) at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnecti o nFromDriverManager(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFactor y .makeObject(Unknown Source) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPo o l.java:710) at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnection F romPool(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConne c tion(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unkno w n Source) at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown Source) at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.beginTransaction(Unkno w n Source) at org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.beginTransaction ( Unknown Source) at com.ckeller.flweb.application.FLApp.login(Unknown Source) ... When Creating a the first PersistenceBroker. Why is OJB using the Databese and and url defined in the repository but not the username and password? I just updated from OJB 0.9.7 to 0.9.9, in 0.9.7 my database setup worked well. What am I doing wrong now? Thanks in Advance for your Time - Cornelius -- Cornelius Keller Stud. Inf. Humbold Universität Berlin --- crewmeber of space station C-Base - culture communication carbonite in berlin visit: http://www.c-base.org/ --- - 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 0.9.9 mysql: Database User password form repository not used?
Yes thats solves the Problem, but then I have to recompile if I want to change the Database settigns, and One of the reaseons for using OJB is that i dont want to. Any other Solutions so that OJB uses the user and Password defined in the repository_databases.xml? I am clling PersistenceBrokerFactory.createPersistenceBroker(default); Thank you Here is what I use for fetching a PersistenceBroker in my code: PersistenceBroker broker = PersistenceBrokerFactory.createPersistenceBroker(new PBKey(default,sa,)); Where sa equals a user id and is the password. Hope this info helps, Jeff On Saturday 01 March 2003 06:19 pm, you wrote: Hello List, I am using the following Connection descriptor: jdbc-connection-descriptor jcd-alias=default default-connection=true platform=MySQL jdbc-level=2.0 driver=org.gjt.mm.mysql.Driver protocol=jdbc subprotocol=mysql dbalias=//localhost:3306/fldb?autoReconnect=true username=root password=x batch-mode=false When creating a Persistence Broker, I am reciving the follwoing Exception : General error: Access denied for user: '@localhost' to database 'fldb' java.sql.SQLException: General error: Access denied for user: '@localhost' to database 'fldb' at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:497) at org.gjt.mm.mysql.Connection.connectionInit(Connection.java:264) at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Connection.java:89) at org.gjt.mm.mysql.Driver.connect(Driver.java:167) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:193) at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConnecti o nFromDriverManager(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFactor y .makeObject(Unknown Source) at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPo o l.java:710) at org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnection F romPool(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupConne c tion(Unknown Source) at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Unkno w n Source) at org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.localBegin(Unknown Source) at org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.beginTransaction(Unkno w n Source) at org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.beginTransaction ( Unknown Source) at com.ckeller.flweb.application.FLApp.login(Unknown Source) ... When Creating a the first PersistenceBroker. Why is OJB using the Databese and and url defined in the repository but not the username and password? I just updated from OJB 0.9.7 to 0.9.9, in 0.9.7 my database setup worked well. What am I doing wrong now? Thanks in Advance for your Time - Cornelius -- Cornelius Keller Stud. Inf. Humbold Universität Berlin --- crewmeber of space station C-Base - culture communication carbonite in berlin visit: http://www.c-base.org/ --- - 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]