DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14542>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14542 ConnectionPools with STRUTS (<datasources> ....) do not work... [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|INVALID | ------- Additional Comments From [EMAIL PROTECTED] 2002-11-18 05:03 ------- Thanks for your inputs. I think I hv solved my problem. It was definitely linked to the data-sources section, cause if you remove it my app works fine (all *.do) except I hv to rely on some other logic to provide Database Connection Pools. Solution: Rewrote the <data-sources> section in struts-config.xml without the <set-property> tags. Instead used,: <data-sources> <data-source id="TPARD" autoCommit="false" description="TPARD_Data_Source_Description" driverClass="oracle.jdbc.driver.OracleDriver" maxCount="4" minCount="2" url="jdbc:oracle:thin:@172.17.8.130:1521:TPARDDM" password="tparddba" user="TPARD_DBA"/> </data-sources> And accessed the pool from within my action class as: GenericDataSource dataSource = (GenericDataSource)servlet.getServletContext ().getAttribute(Action.DATA_SOURCE_KEY); log("dataSource =>" + dataSource); Connection cn = null; try { cn = dataSource.getConnection(); //.... do what ones wants with the connection (fire SQL or...) } catch(SQLException se) { } finally { try { cn.close(); } catch (Exception e) { e.printStackTrace(); } } Alternatively one can create a Database Connection Pool programatically: Hv the foll static code, in a class: public class DBManager { static GenericDataSource dataSource = new GenericDataSource(); static { System.out.println("in static portion of DBManager."); dataSource.setAutoCommit(true); dataSource.setDescription("My Database Connection Pool"); dataSource.setDriverClass("oracle.jdbc.driver.OracleDriver"); dataSource.setMaxCount(4); dataSource.setMinCount(1); dataSource.setPassword("tparddba"); dataSource.setUrl("jdbc:oracle:thin:@pthchase:1521:TPARDDM"); dataSource.setUser("TPARD_DBA"); System.out.println("exit static portion of DBManager."); dataSource.open(); } //and one can get a connection from it as: public static Connection getConnection() throws SQLException { return (Connection)dataSource.getConnection(); } rgds g1 -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>