Works perfectly - thanks! -----Original Message----- From: Armin Waibel [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 3:58 AM To: OJB Users List; [EMAIL PROTECTED] Subject: [patch] Re: PBKey and OJB 0.9.9
Hi Jason, Shannon, I currently checked in the fix. To update version 0.9.9 check out src/java/org/apache/ojb/broker/metadata/ConnectionRepository.java src/java/org/apache/ojb/broker/ta/PersistenceBrokerFactoryDefaultImpl.ja va src/java/org/apache/ojb/broker/util BrokerHelper.java http://cvs.apache.org/viewcvs/jakarta-ojb/src/java/org/apache/ojb/broker / regards, Armin ----- Original Message ----- From: "Jason Mihalick" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]>; "Armin Waibel" <[EMAIL PROTECTED]> Sent: Tuesday, February 11, 2003 2:30 AM Subject: Re: PBKey and OJB 0.9.9 > I whole-heartedly agree. Thanks for responding so quickly, and thanks for > correcting this. Thanks to you too Shannon for the great suggestion. > > -- > Jason > > ----- Original Message ----- > From: "Armin Waibel" <[EMAIL PROTECTED]> > To: "OJB Users List" <[EMAIL PROTECTED]> > Sent: Monday, February 10, 2003 6:01 PM > Subject: Re: PBKey and OJB 0.9.9 > > > > > > ----- Original Message ----- > > From: "Shannon Ewing" <[EMAIL PROTECTED]> > > To: "'OJB Users List'" <[EMAIL PROTECTED]> > > Sent: Monday, February 10, 2003 11:14 PM > > Subject: RE: PBKey and OJB 0.9.9 > > > > > > > Are you saying that if the connection is not "default" then the user > > and > > > password must be passed in despite the fact that the user and password > > is > > > defined in the jdbc-connection-descriptor? This does not make since. > > > The > > > only difference should be the connection being flagged as default > > which > > > would be used for PersistenceBrokerFactory.defaultPersistenceBroker(). > > If > > > PersistenceBrokerFactory.createPersistenceBroker(new PBKey("xyz")) is > > done, > > > then the user and password defined for "xyz" in the > > > jdbc-connection-descriptor should be used. > > > > > > > OK, you are right. This makes sense, I will change this. > > > > thank you Shannon and Jason > > > > regards, > > Armin > > > > > > > > > -----Original Message----- > > > From: Armin Waibel [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, February 10, 2003 3:42 PM > > > To: OJB Users List > > > Subject: Re: PBKey and OJB 0.9.9 > > > > > > > > > Hi Jason, > > > > > > sorry for the hassle, but the new release is more strict in handling > > > different users. Thus OJB try to find a connection without user and > > > password, > > > because both fields were null (new PBKey("mydb")). > > > > > > If you only use > > > one database per application and you set the default-connection > > > attribute > > > 'true' it is possible to use > > > broker = PersistenceBrokerFactory.defaultPersistenceBroker(); > > > > > > If it will help in your case I could do the following: > > > Granted that the jcdAlias name of the PBKey is matching > > > a jdbc-connection-descriptor and the default-connection was set > > 'true', > > > but user and password of the PBKey are 'null', then OJB could use the > > > user and password specified in the descriptor. > > > This will only work if default-connection is set 'true' and you > > > only could define one jdbc-connection-descriptor as the default > > > one. Would this solve your problem? > > > > > > > > > regards, > > > Armin > > > > > > ----- Original Message ----- > > > From: <[EMAIL PROTECTED]> > > > To: <[EMAIL PROTECTED]> > > > Sent: Monday, February 10, 2003 9:23 PM > > > Subject: PBKey and OJB 0.9.9 > > > > > > > > > > Hi, > > > > > > > > I recently reconfigured our application to use the new 0.9.9 > > release. > > > > Previously we were using 0.9.8. We are using the PersistenceBroker > > > API. > > > > After reconfiguring our repository.xml file to use the new jcd-alias > > > > attribute on the connection descriptor, my connection descriptor is > > as > > > > follows: > > > > > > > > <jdbc-connection-descriptor > > > > jcd-alias="mydb" > > > > default-connection="true" > > > > useAutoCommit="1" > > > > platform="Hsqldb" > > > > jdbc-level="2.0" > > > > driver="org.hsqldb.jdbcDriver" > > > > protocol="jdbc" > > > > subprotocol="hsqldb" > > > > dbalias="/tmp/db/mydb" > > > > username="sa" > > > > password="" > > > > /> > > > > > > > > > > > > In my code, I aquire the PersistenceBroker using this method: > > > > > > > > broker = > > ersistenceBrokerFactory.createPersistenceBroker( new > > > > PBKey( "mydb") ); > > > > > > > > > > > > I am curious as to why it is now mandatory to supply the user name > > and > > > > password as part of the key now? I could always store it in > > another > > > file > > > > I suppose, but we are using multiple database platforms each of > > which > > > have > > > > a different username and password. The way this used to work was > > > great! > > > > Anyway that I can make it work as it did before? Is this going to > > > change > > > > back for OJB 1.0 or should I just start planning on getting the user > > > name > > > > and password from elsewhere instead of depending on the connection > > > > descriptor? Right now I receive the following exception : > > > > > > > > [org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl] > > INFO: > > > > Create new connection > > > > > > pool:org.apache.ojb.broker.metadata.JdbcConnectionDescriptor@19f03d7[ > > > > jcd-alias=mydb > > > > default-connection=false > > > > dbms=Hsqldb > > > > jdbc-level=2.0 > > > > driver=org.hsqldb.jdbcDriver > > > > protocol=jdbc > > > > sub-protocol=hsqldb > > > > db-alias=/tmp/db/ams > > > > user=<null> > > > > password=***** > > > > eager-release=false > > > > ConnectionPoolDescriptor={testOnReturn=false, maxWait=5000, > > > > timeBetweenEvictionRunsMillis=-1, testOnBorrow=true, > > > > numTestsPerEvictionRun=10, maxActive=21, removeAbandonedTimeout=300, > > > > removeAbandoned=false, maxIdle=-1, testWhileIdle=false, > > > > whenExhaustedAction=0, logAbandoned=false, > > > > minEvictableIdleTimeMillis=600000} > > > > batchMode=false > > > > sequenceDescriptor=<null> > > > > ] > > > > [org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl] > > > ERROR: > > > > Error getting Connection from DriverManager with url > > > > (jdbc:hsqldb:/tmp/db/ams) and driver (org.hsqldb.jdbcDriver) > > > > User not found: > > > > java.sql.SQLException: User not found: > > > > > > > > at org.hsqldb.Trace.getError(Unknown Source) > > > > at org.hsqldb.Trace.error(Unknown Source) > > > > at org.hsqldb.UserManager.get(Unknown Source) > > > > at org.hsqldb.UserManager.getUser(Unknown Source) > > > > at org.hsqldb.Database.connect(Unknown Source) > > > > at org.hsqldb.jdbcConnection.openStandalone(Unknown Source) > > > > at org.hsqldb.jdbcConnection.<init>(Unknown Source) > > > > at org.hsqldb.jdbcDriver.connect(Unknown Source) > > > > at > > > java.sql.DriverManager.getConnection(DriverManager.java:512) > > > > at > > > java.sql.DriverManager.getConnection(DriverManager.java:193) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.newConne > > > ctionFromDriverManager(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl$ConPoolFac > > > tory.makeObject(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjec > > > tPool.java:710) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl.getConnect > > > ionFromPool(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.ConnectionFactoryAbstractImpl.lookupCo > > > nnection(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.ConnectionManagerImpl.getConnection(Un > > > known > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.accesslayer.StatementManager.getPreparedStatement( > > > Unknown > > > > > > > > Source) > > > > at > > > > > > org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(Unknown > > > > Source) > > > > at > > org.apache.ojb.broker.accesslayer.RsIterator.<init>(Unknown > > > > Source) > > > > at > > > > > > org.apache.ojb.broker.accesslayer.ReportQueryRsIterator.<init>(Unknown > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.singlevm.ReportRsIteratorFactoryImpl.createRsItera > > > tor(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getRsIteratorFromQu > > > ery(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getReportQueryItera > > > torFromQuery(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getReportQueryItera > > > torByQuery(Unknown > > > > > > > > Source) > > > > at > > > > > > > > > org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getReportQuer > > > yIteratorByQuery(Unknown > > > > > > > > Source) > > > > > > > > > > > > > > > > Thanks for the help! > > > > > > > > Jason > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > > 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] > > > > > > > > > +---------------------------------------------------------+ > > > This message may contain confidential and/or privileged information. > > If you > > > are not the addressee or authorized to receive this for the addressee, > > you > > > must not use, copy, disclose or take any action based on this message > > or any > > > information herein. If you have received this message in error, > > please > > > advise the sender immediately by reply e-mail and delete this message. > > > Thank you for your cooperation. > > > +---------------------------------------------------------+ > > > > > > --------------------------------------------------------------------- > > > 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] +---------------------------------------------------------+ This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. +---------------------------------------------------------+ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
