Re: JNDI Datasource in Tomcat
Which database drivers are you using with poolman? I'm trying to use Oracle, but it's giving me null pointer exceptions when I run the test. Could you send your poolman.xml file? Thanks dave eric chacon wrote: You'll need some connection pooling software which doesn't appear to come bundled with Tomcat. There are several open-source connection pools. I've used PoolMan (www.codestudio.com), and found it to work pretty well. I did have a problem using JNDI, which I never successfully resolved, however: to make a Datasource (or any object) available through JNDI, you need to set up a proper security policy. I was never able to deploy a datasource that my servlets could read. Most connection pooling software packages don't require that you use JNDI (they come with propietary configuration files and such). Note: If you use a full J2EE solution such as Enhydra or JBoss (both of which come bundled with Tomcat), then they'll set up your data sources for you (you modify some XML files), and you're good to go. -- Dave Weis businessolver, Inc. [EMAIL PROTECTED] http://www.businessolver.com/
Re: JNDI Datasource in Tomcat
Heh. I am using Postgresql (7.0.2)--and (here's the kicker), I'm using PoolMan 1.4.1, which doesn't have an XML file. I've done some work with the 2.0 beta, but I ran into a problem that appears to be fixed in 2.1, but I haven't had a chance to test it yet. I hope to play with this sometime in the next month, and I'll let you know if I come up with anything. Cheers, E. From: Dave Weis [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Re: JNDI Datasource in Tomcat Date: Mon, 07 May 2001 08:32:37 -0500 Which database drivers are you using with poolman? I'm trying to use Oracle, but it's giving me null pointer exceptions when I run the test. Could you send your poolman.xml file? Thanks dave eric chacon wrote: You'll need some connection pooling software which doesn't appear to come bundled with Tomcat. There are several open-source connection pools. I've used PoolMan (www.codestudio.com), and found it to work pretty well. I did have a problem using JNDI, which I never successfully resolved, however: to make a Datasource (or any object) available through JNDI, you need to set up a proper security policy. I was never able to deploy a datasource that my servlets could read. Most connection pooling software packages don't require that you use JNDI (they come with propietary configuration files and such). Note: If you use a full J2EE solution such as Enhydra or JBoss (both of which come bundled with Tomcat), then they'll set up your data sources for you (you modify some XML files), and you're good to go. -- Dave Weis businessolver, Inc. [EMAIL PROTECTED] http://www.businessolver.com/ _ Get your FREE download of MSN Explorer at http://explorer.msn.com
Re: JNDI Datasource in Tomcat
Hi All, I am using poolman 2.1 for connection pooling. The connection pooling seems to be working fine, but the only problem I seem to be having is that my total connections grow very rapidly. And also the connections used grow at the same pace. I always have 1 or 2 connections available. Could anyone tell me the possible reason for that. Here is my poolman.xml poolman datasource !-- == -- !-- Physical Connection Attributes -- !-- == -- !-- Standard JDBC Driver info -- dbnameproddb-cache/dbname jndiNamejndi-epochdb-cache/jndiName drivercom.sybase.jdbc2.jdbc.SybDriver/driver !-- drivercom.sybase.jdbc.SybDriver/driver -- urljdbc:sybase:Tds:0.0.0.0:4100/url usernameuser/username passwordpass/password !-- If the following element is set to true, then PoolMan's -- !-- scrollable/updatable ResultSet will not be used, and the -- !-- underlying driver's ResultSet will be used instead. This -- !-- provides a performance gain in certain rare instances at -- !-- the expense of functionality. -- !-- DEFAULT: false -- nativeResultsfalse/nativeResults !-- -- !-- Pool Behavior Attributes -- !-- -- !-- Connections created when the pool is instantiated -- !-- DEFAULT: 1 -- initialConnections2/initialConnections !-- The pool will never shrink below this number -- !-- DEFAULT: 0 -- minimumSize0/minimumSize !-- The pool will never grow larger than this value -- maximumSize50/maximumSize !-- The connection will be destroyed after living for a -- !-- duration of this value. IN SECONDS. -- !-- DEFAULT: 1200 (20 minutes) -- connectionTimeout600/connectionTimeout !-- A user will lose a Connection and it will automatically -- !-- return to its pool after the duration greater than or -- !-- equal to this value. IN SECONDS. -- !-- DEFAULT: 20 -- userTimeout10/userTimeout !-- How frequently each object's connection timeout and -- !-- user timeout values will be examined for collection. -- !-- IN SECONDS. -- !-- DEFAULT: 660 (11 minutes) -- skimmerFrequency60/skimmerFrequency !-- Each time the pool is sized down, how many connections -- !-- should be removed from it? This value prevents backing -- !-- off the pool too quickly. -- shrinkBy5/shrinkBy !-- Where should log and debug information be printed? -- !-- DEFAULT: System.out -- logFile/var/log/poolman.log/logFile !-- If set to true, the logger will display verbose info -- !-- DEFAULT: false -- debuggingtrue/debugging !-- XA Connection Attributes -- !-- NOTE: MEASURED IN SECONDS. -- transactionTimeout100/transactionTimeout !-- Query Cache Attributes-- !-- If enabled, queries will be cached. The cache is -- !-- asynchronously updated in the background. -- !-- DEFAULT: false -- cacheEnabledtrue/cacheEnabled !-- The maximum number of query/ResultSet pairs the -- !-- cache can contain. -- !-- DEFAULT: 5 -- cacheSize500/cacheSize !-- How long the cache waits before re-loading its -- !-- ResultSets from the underlying database. -- !-- IN SECONDS. -- !-- DEFAULT: 30 -- cacheRefreshInterval21600/cacheRefreshInterval !-- A SQL statement to be executed when the pool is created.-- !-- DEFAULT: none -- !-- initialPoolSQL insert into users values(32, 'xml') /initialPoolSQL /poolman Can someone tell me if I am doing anything wrong in this... or I have to set some other parameters. Also, when the total connection objects become high... I start getting lots of Arrayindexoutofbounds exception. I have to cycle my server to avoid getting these errors. Thanks and Regards Manish
JNDI Datasource in Tomcat
Hi I try to use JNDI to get datasource in tomcat. How can I config a jndi datasource in tomcat so i can get datasource as follow code? Thanks Harden === public AttributeDAO(String dataSource) throws AttributeDAOException { try { InitialContext ic = new InitialContext(); datasource = (DataSource) ic.lookup(dataSource); } catch (NamingException ne) { throw new AttributeDAOException(NamingException while looking + up DB context : + ne.getMessage()); } }
Re: JNDI Datasource in Tomcat
Harden, You'll need some connection pooling software which doesn't appear to come bundled with Tomcat. There are several open-source connection pools. I've used PoolMan (www.codestudio.com), and found it to work pretty well. I did have a problem using JNDI, which I never successfully resolved, however: to make a Datasource (or any object) available through JNDI, you need to set up a proper security policy. I was never able to deploy a datasource that my servlets could read. Most connection pooling software packages don't require that you use JNDI (they come with propietary configuration files and such). Note: If you use a full J2EE solution such as Enhydra or JBoss (both of which come bundled with Tomcat), then they'll set up your data sources for you (you modify some XML files), and you're good to go. Cheers, E. From: Harden ZHU [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JNDI Datasource in Tomcat Date: Sun, 6 May 2001 23:04:07 -0400 Hi I try to use JNDI to get datasource in tomcat. How can I config a jndi datasource in tomcat so i can get datasource as follow code? Thanks Harden === public AttributeDAO(String dataSource) throws AttributeDAOException { try { InitialContext ic = new InitialContext(); datasource = (DataSource) ic.lookup(dataSource); } catch (NamingException ne) { throw new AttributeDAOException(NamingException while looking + up DB context : + ne.getMessage()); } } _ Get your FREE download of MSN Explorer at http://explorer.msn.com