[Objectbridge-developers] AW: [Fwd: Re: ConnectionManager]
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-09-24 11:56:39
|
Hi Satish, > > Hi Thomas, > > I will do that right away. Thank you!! > > I noticed another problem. Basically, if the database is > down when I do a query using PersistenceBroker, I do not > get a PersistenceBroker exception. It seems that the SQL > exceptions are caught and handled but not rethrown. At the > app layer, It makes it very hard to report errors or do > any error handling. For example, a broker.getCollectionByQuery > will return an empty iterator. So, for the app, it seems like > there are no elements that match the query in db. > In it's early days OJB caught most exceptions. There are still places where exceptions are not properly reached to the client app. I will have a code walkthrough to improve this situation. > Hope my feedback is useful and doesn't sound like whining. As always: thanks for your carefull observance. Each reported bug will improve OJB so it's definitely useful! thanks, Thomas > > Thank you, > Satish. > > > On Wed, 01 Jan 1997 01:07:56 +0100 Thomas Mahler > <tho...@ho...> wrote: > >Hi Satish, > >sa...@na... wrote: > >> > >> Hi Thomas, > >> > >> I have been noticing that lots of JDBC connections were getting > >> created for simple queries using the same broker instance. > >> > >> Then I noticed that new ConnectionManager > >> instances were getting created for each query using the same broker > >> instance. I inserted some debug statements and I think I might be > >> seeing a bug. > >> > >> Basically, since the connectionTable is empty for a new > ConnectionManager > >> (created in StatementsForClass), getNewConnection is called in > >> ConnectionManager. Also curious is why the > connectionManager object in > >> PersistenceBroker was not being used? > >> > >> I haven't had the time to put together a simple case that > you can use. > >> But, if you need, I will do so. > >> > >> Please let me know. > >> > >> If you do have a fix for this, can you mail it to me since > I need to get > >> this software out as soon as possible. > >> > >Yes, this is definitely a bug. Sascha reported it some days ago and I > >already prepared a fix. > >As I did a lot of other internal changes in the meantime > that won't be > >compatible to your sources I can't send you the patched files. > >But fortunately it's not difficult to do: > >1. provide PersistenceBrokerImpl with a public method > >getConnectionManager(): > >public ConnectionManager getConnectionManager() > >{ > > return m_ConnectionManager; > >} > > > >2. in the StamentsForClass constructor change the line > > ConnectionManager manager = new ConnectionManager(broker); > > > >to: > > > > ConnectionManager manager = broker.getConnectionManager(); > > > >3. That's it! > > > >> Also, did you get a chance to look at my previous email regarding > >> mysql wait_timeouts on idle connections and hence you can > be left with > >> stale connections in the pool (the server pool). > >> > > > >Yes, but it's not easy to simulate this behaviour with instantdb. I > >assume that the method java.sql.Connection.isClosed() will > return true > >or throws an SQLException in this case. > >I will write some code that will use isClosed() to check if the > >connection is still valid and will acquire a fresh one if > necessary. The > >fix will be in the next release. (by the end of the week) > > > >HTH, > > > >Thomas > > > >> Thanks for all your help, > >> Satish. > >> > >> -- > >> Get your firstname@lastname email for FREE at http://Nameplanet.com/?su > > -- Get your firstname@lastname email for FREE at http://Nameplanet.com/?su |