[Objectbridge-developers] AW: [Fwd: broker instance vs Connection instance]
Brought to you by:
thma
From: Mahler T. <tho...@it...> - 2001-09-24 11:52:04
|
Hi Satish, > -------- Original Message -------- > Subject: broker instance vs Connection instance > Date: 23 Sep 2001 19:36:28 -0000 > From: sa...@na... > To: tho...@ho... > > Hi Thomas, > > I am a little confused with the behavior I am noticing: > > Basically, it seems that the same JDBC Connection object can > be used by different broker instances. My (probably incorrect) > assumption was that a (physical) JDBC Connection is not shared > between broker instances. > > I have been looking around the code and I notice that > > StatementManager.getStatementsForClass() creates new > StatementsForClass > object if not already in its statementTable. > > So, if broker1 is used to get conn1 and hence stmt1, then later on the > same query (stmt1) will use conn1 even if broker2 is used to do the > query. > conn2 is not created in this case. > > Is this the desired behavior? I guess I do not understand the > relationship > between PersistenceBroker and actual JDBC connection. > Thanks for you careful examination. The connections must be used exclusively for one broker to maintain transactional integrity. Each PersistenceBrokerImpl has a ConnectionManager that holds a table of connections exclusively for this broker. StatementsForClass needs connections to create JDBC Statements. StatementsForClass uses the broker's ConnectionManager to obtain connections. I had a look at the code and could no defect in this depencies, so there should be no conflicts... -- Thomas > Thanks, > Satish. > > -- > Get your firstname@lastname email for FREE at http://Nameplanet.com/?su |