[Proxool-user] Oracle DB with proxool in Tomcat - Hot deployment
UNMAINTAINED!
Brought to you by:
billhorsman
From: Bachert, T. <t.b...@mp...> - 2009-07-22 14:01:56
|
Hi, I realized a strange behaviour when using proxool within a web application in Tomcat. I can not use the hot deploy feature of Tomcat when I accessed a ORACLE database with proxool before. If I use a SQL-server databse it works. I used the sample below for testing purposes. At first I call initPool via webservice, after that I call testDbOra and at last I call stopPool. Now I delete the file TestServices.war in tomcat's webapps folder to hot undeploy the application. That doesn't work, because the ojdbc5.jar file with the oracle driver can not be deleted (In the log is no exception, it just doesn't work). If I do the same test with the jtds driver for SQL server, it works fine. Has anyone an idea what the problem is? Kind regards Timo /** * * Webservice test class for ORA hot deploy problem * * @author tba * */ @WebService @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED, use = SOAPBinding.Use.LITERAL) @BindingType(value = javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING) public class TestService { /** * * Test method for DB access (ora) * */ @WebMethod(action = "testDbOra") public void testDbOra() { Connection con = null; PreparedStatement stmt=null; ResultSet rs = null; try { con = DriverManager.getConnection("proxool." + "Win2003-15-2"); stmt=con.prepareStatement("select * from setup"); rs=stmt.executeQuery(); while(rs.next()) { System.out.println("Col 1: " + rs.getString(1)); } } catch (final Exception exc) { throw new RuntimeException("Error at execution of sql statement", exc); } finally { if(rs!=null) { try { rs.close(); } catch (SQLException e) { e.printStackTrace(); } } if(stmt!=null) { try { stmt.close(); } catch (SQLException e) { e.printStackTrace(); } } if(con!=null) { try { con.close(); } catch (SQLException e) { e.printStackTrace(); } } } } /** * * Init db pool * */ @WebMethod(action = "initPool") public void initPool() { Properties props=new Properties(); props.put("jdbc-0.proxool.alias", "Win2003-15-2"); props.put("jdbc-0.proxool.driver-url", "jdbc:oracle:thin:@win2003-15:1521:hyd2"); props.put("jdbc-0.proxool.driver-class", "oracle.jdbc.driver.OracleDriver"); props.put("jdbc-0.user", "user"); props.put("jdbc-0.password", "password"); props.put("jdbc-0.proxool.maximum-connection-count", "10"); props.put("jdbc-0.proxool.minimum-connection-count", "2"); props.put("jdbc-0.proxool.maximum-connection-lifetime", "18000000"); props.put("jdbc-0.proxool.simultaneous-build-throttle", "5"); props.put("jdbc-0.proxool.recently-started-threshold", "60000"); props.put("jdbc-0.proxool.overload-without-refusal-lifetime", "60000"); props.put("jdbc-0.proxool.maximum-active-time", "1800000"); props.put("jdbc-0.proxool.prototype-count", "2"); try { PropertyConfigurator.configure(props); } catch (ProxoolException e) { throw new RuntimeException("Error initializing proxool pool", e); } } /** * * Stop db pool * */ @WebMethod(action = "stopPool") public void stopPool() { ProxoolFacade.shutdown(0); } } Mit freundlichen Grüßen Timo Bachert Dipl. Ing. (BA) Anwendungsentwickler _________________________________________________________________________ MPDV Mikrolab GmbH | www.mpdv.de Römerring 1 | 74821 Mosbach | Deutschland Fon: +49 (62 61) 92 09-0 | mailto:t.b...@mp... Amtsgericht Mannheim, HRB-Nr. 440684 Geschäftsführer: Prof. Dr.-Ing. Jürgen Kletti, Dipl.-Ing. (FH) Hans Götz _________________________________________________________________________ Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet. This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. |