On Fri, 8 Dec 2000, Todd Mayfield wrote:
> Hello,
>
> I have a couple questions about Orion and EJB in general.
>
> 1. Shouldn't the server pool database connections ? It is not.
Ah so! But it does. :)
> 2. If so, is there something we are missing in the configuration to allow
> this ? We have tried our own code and sample code found on
> www.orionsupport.com.
Use a pooled-location instead. :) See the data-sources.xml docs on
orionserver.
> This is the entry from data-sources.xml:
>
> <data-source class="com.evermind.sql.DriverManagerDataSource" name="Mas"
> location="jdbc/MasCoreDS" xa-location="jdbc/xa/MasXADS"
> ejb-location="jdbc/MasDS"
> connection-driver="oracle.jdbc.driver.OracleDriver" username="outage"
> password="outage" url="jdbc:oracle:thin:@10.27.2.21:1521:v8i815"
> inactivity-timeout="1"/>
>
> Notice the inactivity-timeout=1 attribute. This is required for stress
> testing since the connections are not being pooled. Otherwise we very
> quickly run into the max connections. Orion is keeping the connections open
> for the timeout period but not reusing them when we request another. On the
> server, we see the connections held open with no user associated with them
> after the connection is closed until the timeout expires, then they go away.
>
> This is the test code, which acts just like our code, pretty much pasted
> from the servlet example on www.orionsupport.com.
>
>
> package cc.nisc.outage.servlet;
>
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.io.*;
> import java.sql.*;
> import javax.sql.DataSource;
> import javax.naming.InitialContext;
>
> public class TestServlet extends HttpServlet {
>
> public void doGet(HttpServletRequest req, HttpServletResponse res) {
> try {
> // Obtain connection
> InitialContext ctx = new InitialContext();
> DataSource ds = (DataSource) ctx.lookup("jdbc/Mas");
> Connection conn = ds.getConnection();
>
> // Create query and get results
> Statement stmt = conn.createStatement();
> ResultSet rs = stmt.executeQuery("SELECT table_name FROM
> user_tables");
>
> // List results
> while ( rs.next() ) {
> System.out.println( rs.getString("table_name") + "<br>");
> }
>
> // Close connection - important!
> conn.close();
> } catch (Exception e) {
> System.out.println("error:" + e);
> }
> }
> }
>
>
> I would appreciate anyone's help here.
>
> Todd Mayfield
> National Information Solutions Cooperative
> Product Development and Implementation
> [EMAIL PROTECTED]
>
>
>
>
-----------------------------------------------------------
Joseph B. Ottinger [EMAIL PROTECTED]
http://cupid.suninternet.com/~joeo HOMES.COM Developer