Re: [Objectbridge-developers] connection questions
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2001-06-02 11:38:38
|
Hi Steven, Thanks for your interest! "Melzer, Steven" wrote: > > Hello, my name is Steven Melzer and I am new to both ObjectBridge and > persistence in general. I have been looking for a persistence solution for > our web based database storage. We are an Oracle shop using Weblogic as our > application server. I downloaded ObjectBridge and built a very simple > example using MySQL on my local machine at home. It worked well. But I > have several questions when it comes to integrating it with WebLogic: > > 1) It seems that the ConnectionManager holds its own pool of connections. I > wish to use WebLogic's DataSource as a connection pool. I can see how to > change the source to do this, but i did not want to modify core code without > some feedback. > I think it won't be a big help to rewrite the StatementManager to use a DataSource pool. If you have a look at the source of StatementManager::getStatementForClass(...) you will see that we have one StatementsForClass instance per persistent class (or ClassDecriptor to be exact). each instance keeps for PreparedStatements for permanent reuse: - selectByPkStmt - insertStmt - updateStmt - deleteStmt To keep these statements "hot" implies to keep the underlying connections permanently open. Thus a ConnectionPool would not be of any use. That's why there is no Connection.close() anywhere. (Maybe I should put it into some finalizers, but until now this produced no problems.) I chose this design to get a maximum performance by only preparing those Statements once and resusing them later. Of course you can easily change ConnectionManager and StatementsForClass together to use your ConnectionPool. In fact OJB had such a ConnectionPool at some earlier point in time. > 2) The ConnectionManager is a singleton class holding connections. However, > I never see these connection being released anywhere. I check > StatementForClass and StatementManager, but I cannot find a > connection.close(). If the connection is maintained in the > ConnectionManager and never released, then the entire application in > WebLogic will share the same connections. If our app has hundreds of > simultaneous users, then the single connection is going to be a major > bottleneck. This goes back to the first question above. > In my eyes the bottleneck with the current design of OJB is the PersistenceBrokerImpl itself. If you have a look at PersistenBrokerImpl.beginTransaction() you will easily see that it can only perform one Transaction at a time. And as it is a singleton instance this will be the true bottleneck! If you use the odmg implementation this bottleneck situation will be reduced, as it opens broker transactions only for a very short period of time. But if you confront it with really heavy load it will od course have the same problem... The bad news: right now OJB does NOT scale! So you will need some load testing whether it can be savely used in your environment or not. I have been using OJB with IBM WebSphere with only 5-10 concurrent users without specific problems! The good news: I'm just finished with the 0.5 release which completed the ODMG API. My next deliverable is a scalable distributed architecture for OJB. This will of course take a while... By the way: - are you planning to use EntityBeans. If so you might have a look at my BMP sample code in package test.ojb.ejb! - Are there any special reasons why don't you use WebLogics standard persistence framework TopLink? best regards, Thomas Mahler > thanks in advance, > steve > > Steven Melzer > E-Business Technology > 813.351.2215 > ste...@pa... > > _______________________________________________ > Objectbridge-developers mailing list > Obj...@li... > http://lists.sourceforge.net/lists/listinfo/objectbridge-developers |