Thanks again Burt, Ill try it out and see what happens ... The problem as I see it is that all these different ORM tools have their own non standard interfaces... I tried Castor and TJDO before. Thats why I want an open source JDO ;-) (preferably as part of j2ee). Well, future will tell...
----- Original Message ----- From: "BURT, RANDALL (CONTRACTOR)" <[EMAIL PROTECTED]> To: "OJB Users List" <[EMAIL PROTECTED]> Sent: Thursday, June 05, 2003 5:26 PM Subject: RE: How to configure OJB with Tomcat > I can't speak to the JDO implementation, as I have only used the PBAPI. As to what component has the responsibility for connection pooling, IMHO, the data access/ORM component seems to be the more logical place, regardless of canonical J2EE. > > As for your connection manager choices, this is from the OJB.properties file that ships with RC3: > #--------------------------------------------------------------------------- ------------- > # ConnectionFactory / Default ConnectionPool > #--------------------------------------------------------------------------- ------------- > # The ConnectionFactoryClass entry determines which kind of ConnectionFactory > # is to be used within org.apache.ojb as connection factory. > # A ConnectionFactory is responsible for creating > # JDBC Connections. Current version ships four implementations: > # > # 1. ConnectionFactoryNotPooledImpl > # No pooling, no playing around. > # Every connection request returns a new connection, > # every connection release close the connection. > # 2. ConnectionFactoryPooledImpl > # This implementation supports connection pooling. > # 3. ConnectionFactoryDBCPImpl > # Using the jakarta-DBCP api for connection management, support > # connection- and prepared statement-pooling, abandoned connection handling. > # 4. ConnectionFactoryManagedImpl > # Connection factory for use within managed environments - e.g. JBoss. > # Every obtained DataSource was wrapped within OJB (and ignore > # e.g. con.commit() calls within OJB). > # Use this implementation e.g if you use Datasources from an application server. > # > # Use the OJB performance tests to decide, which implementation is best for you. > # The proper way of obtaining a connection is configured in > # JDBCConnectionDescriptor entries in the repository.xml file. > # If want a more fine grained control of each connection pool used by OJB, > # take a look at the repository.dtd, there was a possibility to override > # this default connection factory entry in each JDBCConnectionDescriptor. > > Sounds to me that if you want to use your container to manage connections, you would need to use ConnectionFactoryManagedImpl and not ConnectionFactoryDBCPImpl, but I may be missing something. > > I can't really speak to PBAPI vs. JDO (haven't used JDO), but I can tell you the PBAPI is clean, powerful, and a joy to use! > > -----Original Message----- > From: Lukas Severin [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 05, 2003 10:12 AM > To: OJB Users List > Subject: Re: How to configure OJB with Tomcat > > > Thanks. Would it make a difference in setup of the pooling in the JDO case > compared to the PBAPI ? Is it not strange to have the pooling in OJB, when > this should be the task of the container (at least in the j2ee world) ? Does > it matter which connection manager to choose ? I feel inclined to choose the > DBCP based, but what do I know ;-) > > Burt, you are using the PBAPI, and I have decided to go for the java > standard JDO. What difference regarding pooling and synchronization can I > expect ? > > Anyone else care to share their opinions on this ? > > > > ----- Original Message ----- > From: "BURT, RANDALL (CONTRACTOR)" <[EMAIL PROTECTED]> > To: "OJB Users List" <[EMAIL PROTECTED]> > Sent: Thursday, June 05, 2003 4:12 PM > Subject: RE: How to configure OJB with Tomcat > > > > My pleasure. I also am using OJB with Tomcat in my project, but I am not > using a JNDI datasource. Since I am using the PBAPI, I just configure my > connection in my repository-database.xml and specify one of the "pooled" > connection manager implementations in my OJB.properties. OJB then handles > the connection pooling for you. > > > > -----Original Message----- > > From: Lukas Severin [mailto:[EMAIL PROTECTED] > > Sent: Thursday, June 05, 2003 9:04 AM > > To: OJB Users List > > Subject: Re: How to configure OJB with Tomcat > > > > > > Thanks Burt, > > > > Well, first I want to say I am new to OJB so maybe I havent fully > understood > > what can be read at the website. That said, this is what I mean : > > > > When doing standard BMP EJBs or JDBC I am used to configuring a Datasource > > in Tomcat > > which is a standard interface to a pool of connections that I can > configure > > in the Context tag of Tomcats server.xml. I name this myDatasource and > cann > > access it from my business delegate or any bean using > > > > ... > > Context ctx = new InitialContext(); > > DataSource ds = (DataSource)ctx.lookup("java:comp/env/myDatasource"); > > conn = ds.getConnection(); > > etc... > > > > Here the Datasource is a common interface to the pool of connections setup > > my Tomcat. > > > > Now, in the OJB/JDO case, all examples I have seen (also in the web case) > > let the client create a new factory for each access : > > PersistenceManagerFactory factory = new OjbStorePMF(); > > PersistenceManager pm = factory.getPersistenceManager(); > > Transaction tx = pm.currentTransaction(); > > etc ... > > > > I thought this was a gigantic overhead creating a new factory for each > > client call ? > > Are you saying that behind the factory a pool of connections is already > > handled and I need to do nothing to configure Tomcat ? Is there no need to > > setup a JNDI name ? > > > > I found all the different type of ConnectionFactories in OJB.properties, > but > > didnt really get it since I thought this was the containers (ie Tomcats) > job > > to handle, for example using jakarta-commons-dbcp. So what I am saying is > > that all I need is a pooled connection to the underlying database. > > > > > > Thanks for help ! > > > > > > > > ----- Original Message ----- > > From: "BURT, RANDALL (CONTRACTOR)" <[EMAIL PROTECTED]> > > To: "OJB Users List" <[EMAIL PROTECTED]> > > Sent: Thursday, June 05, 2003 3:37 PM > > Subject: RE: How to configure OJB with Tomcat > > > > > > > Pooling other than what OJB provides? > > > > > > -----Original Message----- > > > From: Lukas Severin [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, June 05, 2003 6:36 AM > > > To: OJB Users List > > > Subject: How to configure OJB with Tomcat > > > > > > > > > I read the documentation about setting up OJB in a servlet. However I > > > couldnt find any instructions on how to configure connection pooling (eg > > > using jakarta-commons) together with OJB in Tomcat so that connections > to > > > the database is pooled. Are there any synchronization issues to be > careful > > > about ? > > > > > > Can anyone point me to the right doc, or help me out with example tomcat > > > descriptors and client code ? > > > > > > Thanks ! > > > > > > > > > --------------------------------------------------------------------- > > > 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] > > > > > --------------------------------------------------------------------- > 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]
