AW: JDBC connection leak

2002-03-08 Thread Marc Lehnert

Hi!
Problem solved. I removed all the JDBC things and implemented two more
finder methods for min and max of date such as:

finder-method query=$rw_websiteID = $1 and rw_datetime in (select min
(rw_datetime) from logfilerow where $rw_websiteID = $1)
  method
ejb-nameLogFileRow/ejb-name
method-namefindByMinDateWebsite/method-name
method-params
  method-paramjava.lang.String/method-param
/method-params
 /method
/finder-method


Thanks.

Marc.




JDBC connection leak

2002-03-07 Thread Marc Lehnert

Hello!
I call the following code in a Message Driven Bean in Orion 1.5.2. After the
conn.close() all entity beans I created in some code before are destroyed.
The database is empty. The sql statement gets the right result but after the
close everything is lost. No error, nothing. Without the close statement
Orion says that there is a leaked connection and that I have to close it:
==
OrionCMTConnection not closed, check your code!
LogicalDriverManagerXAConnection not closed, check your code!
(Use -Djdbc.connection.debug=true to find out where the leaked connection
was created)
==

Can anybody help me?

Thanks in advance.

Marc Lehnert,.


The code:


PreparedStatement stmt = null;
java.sql.Timestamp siteEndDate;
java.sql.Timestamp siteBeginDate;

try {

  javax.sql.DataSource ds =
(javax.sql.DataSource)jndiContext.lookup(jdbc/sapdbDS);
  Connection conn = ds.getConnection();

  //Connection conn =
ConnectionFactory.getConnection(jdbc/sapdbDS);
  
  String sqlStatement = select max(rw_datetime),
min(rw_datetime) from logfilerow where rw_websiteid = ?;
  
  stmt = conn.prepareStatement(sqlStatement);
  stmt.setString(1, websiteid);
  ResultSet rs = stmt.executeQuery();
  rs.next();
  siteEndDate = rs.getTimestamp(1);
  siteBeginDate = rs.getTimestamp(2);

conn.close();
  
} catch (Exception e) {
  e.printStackTrace();
  throw e;
}




Re: JDBC connection leak

2002-03-07 Thread Stephen Davidson

Hi Marc.

Maybe try a conn.commit() before conn.close()?

-Steve

Marc Lehnert wrote:
 Hello!
 I call the following code in a Message Driven Bean in Orion 1.5.2. After the
 conn.close() all entity beans I created in some code before are destroyed.
 The database is empty. The sql statement gets the right result but after the
 close everything is lost. No error, nothing. Without the close statement
 Orion says that there is a leaked connection and that I have to close it:
 ==
 OrionCMTConnection not closed, check your code!
 LogicalDriverManagerXAConnection not closed, check your code!
 (Use -Djdbc.connection.debug=true to find out where the leaked connection
 was created)
 ==
 
 Can anybody help me?
 
 Thanks in advance.
 
 Marc Lehnert,.
 
 
 The code:
 
 
 PreparedStatement stmt = null;
 java.sql.Timestamp siteEndDate;
 java.sql.Timestamp siteBeginDate;
 
 try {
 
   javax.sql.DataSource ds =
 (javax.sql.DataSource)jndiContext.lookup(jdbc/sapdbDS);
   Connection conn = ds.getConnection();
 
   //Connection conn =
 ConnectionFactory.getConnection(jdbc/sapdbDS);
   
   String sqlStatement = select max(rw_datetime),
 min(rw_datetime) from logfilerow where rw_websiteid = ?;
   
   stmt = conn.prepareStatement(sqlStatement);
   stmt.setString(1, websiteid);
   ResultSet rs = stmt.executeQuery();
   rs.next();
   siteEndDate = rs.getTimestamp(1);
   siteBeginDate = rs.getTimestamp(2);
 
 conn.close();
   
 } catch (Exception e) {
   e.printStackTrace();
   throw e;
 }
 
 
 



-- 
Stephen Davidson
Java Consultant
Delphi Consultants, LLC
http://www.delphis.com
Phone: 214-696-6224 x208





RE: JDBC connection leak

2002-03-07 Thread John Creaner

Hi,

Not sure if this is what your looking for but you should really close all
associations to the connection
cause I think that the way CMT works with orion is that the close method
merely returns it to the pool
so you should do the following before you close:

 stmt = conn.prepareStatement(sqlStatement);
  stmt.setString(1, websiteid);
  ResultSet rs = stmt.executeQuery();
  rs.next();
  siteEndDate = rs.getTimestamp(1);
  siteBeginDate = rs.getTimestamp(2);

// Here
rs.close ();
stmt.close ();

conn.close();

This means that the connection is now free for the CMT to use again (I THINK
;)


john


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Marc Lehnert
Sent: 07 March 2002 15:56
To: Orion-Interest
Subject: JDBC connection leak


Hello!
I call the following code in a Message Driven Bean in Orion 1.5.2. After the
conn.close() all entity beans I created in some code before are destroyed.
The database is empty. The sql statement gets the right result but after the
close everything is lost. No error, nothing. Without the close statement
Orion says that there is a leaked connection and that I have to close it:
==
OrionCMTConnection not closed, check your code!
LogicalDriverManagerXAConnection not closed, check your code!
(Use -Djdbc.connection.debug=true to find out where the leaked connection
was created)
==

Can anybody help me?

Thanks in advance.

Marc Lehnert,.


The code:


PreparedStatement stmt = null;
java.sql.Timestamp siteEndDate;
java.sql.Timestamp siteBeginDate;

try {

  javax.sql.DataSource ds =
(javax.sql.DataSource)jndiContext.lookup(jdbc/sapdbDS);
  Connection conn = ds.getConnection();

  //Connection conn =
ConnectionFactory.getConnection(jdbc/sapdbDS);

  String sqlStatement = select max(rw_datetime),
min(rw_datetime) from logfilerow where rw_websiteid = ?;

  stmt = conn.prepareStatement(sqlStatement);
  stmt.setString(1, websiteid);
  ResultSet rs = stmt.executeQuery();
  rs.next();
  siteEndDate = rs.getTimestamp(1);
  siteBeginDate = rs.getTimestamp(2);

conn.close();

} catch (Exception e) {
  e.printStackTrace();
  throw e;
}






Re: JDBC connection pooling and ORION

2001-05-06 Thread Vic Cekvenich

Does the DB Connection pool shrink?

Vic
- Original Message -
From: Frank LaRosa [EMAIL PROTECTED]
To: Orion-Interest [EMAIL PROTECTED]
Sent: Wednesday, April 25, 2001 10:17 PM
Subject: Re: JDBC connection pooling and ORION


 Like a lot of things in Orion, this is not particularly well documented.
 Here is how I have mine set up. The name identified as the
pooled-location
 appears to behave as a pooled data source when I reference it from my
 application.

  data-source
   class=com.evermind.sql.DriverManagerDataSource
   connection-driver=sun.jdbc.odbc.JdbcOdbcDriver
   name=SQLServer
   location=jdbc/SQLServerCore
   xa-location=jdbc/xa/SQLServerXA
   ejb-location=jdbc/SQLServerEjb
   pooled-location=jdbc/SQLServer
   username=
   password=
   url=jdbc:odbc:LocalServer
   inactivity-timeout=30
   min-connections=5
   max-connections=1000
  /

 - Original Message -
 From: Hao H Ngo [EMAIL PROTECTED]
 To: Orion-Interest [EMAIL PROTECTED]
 Sent: Wednesday, April 25, 2001 2:08 PM
 Subject: JDBC connection pooling and ORION


  Can someone tell me how to get JDBC connection pooling to work?
  Maybe some examples?  I can't find anything on connection pooling.
  I have successfully made a JDBC connection to postgres, but I would like
  to grab connections from a pool and release to that pool.
 
  Help?
 
 
 








JDBC connection pooling and ORION

2001-04-25 Thread Hao H Ngo

Can someone tell me how to get JDBC connection pooling to work?
Maybe some examples?  I can't find anything on connection pooling.
I have successfully made a JDBC connection to postgres, but I would like
to grab connections from a pool and release to that pool.

Help?






com.evermind...HttpIOException and Xerces blocking JDBC Connection

2001-03-23 Thread Michael N. Christoff

I wrote a servlet that parses the input stream of a request in the doPost()
method using xerces.  If I parse the input stream and then try to use jdbc,
the following line stalls:

Connection con = DriverManager.getConnection();

After about 5 seconds of waiting for that line to execute, I get the
following exception:

Read timed out
com.evermind.server.http.HttpIOException: Read timed out
at com.evermind.server.http.e1.read(JAX)
at java.io.BufferedInputStream.read1(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at
org.apache.xerces.utils.ChunkyByteArray.fill(ChunkyByteArray.java:209)
at
org.apache.xerces.utils.ChunkyByteArray.init(ChunkyByteArray.java:98)
at
org.apache.xerces.readers.DefaultReaderFactory.createReader(DefaultReaderFac
tory.java:153)
at
org.apache.xerces.framework.XMLParser.startReadingFromDocument(XMLParser.jav
a:2403)
at
org.apache.xerces.framework.XMLParser.parseSomeSetup(XMLParser.java:346)
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1207)
at com.crysalis.messaging.mxml.MxmlParser.parse(MxmlParser.java:161)
at
com.crysalis.messaging.server.MxmlRouter.doPost(MxmlRouter.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:204)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:302)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:329)
at com.evermind.server.http.d3.sw(JAX)
at com.evermind.server.http.d3.su(JAX)
at com.evermind.server.http.ef.s1(JAX)
at com.evermind.server.http.ef.do(JAX)
at com.evermind.util.f.run(JAX)

If I remove the code that parses the input stream, everything works
correctly.  Here is a sample of my current code:

 BufferedInputStream bis = new
BufferedInputStream(request.getInputStream());
 MxmlParser parser = new MxmlParser();
 inMsg = parser.parse(bis);// this method uses xerces SAX parser
 bis.close();
  ...
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// line below never finishes executing
Connection con = DriverManager.getConnection(jdbcURL);

I must point out that it is not the length of time it takes to parse the xml
that is causing the timeout.  In the code, the xml is fully parsed before
the jdbc call is made, and the jdbc call alone takes stalls for over 5
seconds before the exception is thrown!  When I remove the code that parses
the xml, the jdbc call is completed in less than 0.5 seconds.

Anyone know whats going on?  Anyone seen anything like this before?



Mike Christoff






A newbie question - problems with JDBC-connection

2000-11-28 Thread theis . meggerle

Hi!

I am pretty new to applicationservers and thus trying the grasp the nuts and bolts.
I have just finished a sessionbean (via a servlet) which connects to a database and 
reads a specified table.
Everything works fine the first time a run my servlet. But the second time, I get no 
connection,
either of the pool or a new one. I run my example, as recommended, by 
ejb-location="jdbc/DefaultEJBDS"
and I am using classes111.zip from Oracle.

Can anyone help with this problem and also explain the principals behind what is 
happening below.

C:\orionjava -Ddatasource.verbose=true -jar orion.jar
DataSource logwriter activated...
jdbc:oracle:thin:@myserver:1521:myInstance: Started
jdbc:oracle:thin:@myserver:1521:myInstance: Started
Orion Pooled jdbc:oracle:thin:@myserver:1521:myInstance: Started
Orion/1.3.8 initialized
Created new physical connection: XA XA Orion Pooled jdbc:oracle:thin:@myserver:1521
:SATT
null: Connection XA XA Orion Pooled jdbc:oracle:thin:@myserver:1521:myInstance 
allocated
(Pool size: 0)
jdbc:oracle:thin:@myserver:1521:myInstance: Opened connection
Created new physical connection: Pooled oracle.jdbc.driver.OracleConnection@c24c
0
Pooled jdbc:oracle:thin:@myserver:1521:SATT: Connection Pooled oracle.jdbc.driver.O
racleConnection@c24c0 allocated (Pool size: 0)
Pooled jdbc:oracle:thin:@myserver:1521:SATT: Releasing connection Pooled oracle.jdb
c.driver.OracleConnection@c24c0 to pool (Pool size: [Ljavax.sql.PooledConnection
;@5f8172)
null: Releasing connection XA XA Orion Pooled 
jdbc:oracle:thin:@myserver:1521:myInstance
to pool (Pool size: [Ljavax.sql.PooledConnection;@2ba11b)
Orion Pooled jdbc:oracle:thin:@myserver:1521:myinstance: Cache timeout, closing 
connectio
n (Pool size: 0)
jdbc/DefaultEJBDS: Cache timeout, closing connection (Pool size: 0)

Best regards

/Theis





RE: A newbie question - problems with JDBC-connection

2000-11-28 Thread Kevin Duffey

If you don't mind..can you help explain to me how you even got this far? I
just installed Oracle Personal Edition, and I would like to get Orion to
pool connections, use a DataSource, and so on. I don't know about using
entity beans yet..I don't think EJB 1.1 entity is powerful enough yet..but
2.0 should be. Until then, I only have 5 tables to work with, which I will
use SQL for in the EJB session bean.

So if you could possibly explain what JDBC type 4 driver you are using
(where you got it from.URL?), how you got Orion to use it as a DataSource
instead of the Hypersonic SQL one it defaults to, and so on...I would be
much appreciated.

Thanks.

 Hi!

 I am pretty new to applicationservers and thus trying the grasp
 the nuts and bolts.
 I have just finished a sessionbean (via a servlet) which connects
 to a database and reads a specified table.
 Everything works fine the first time a run my servlet. But the
 second time, I get no connection,
 either of the pool or a new one. I run my example, as
 recommended, by ejb-location="jdbc/DefaultEJBDS"
 and I am using classes111.zip from Oracle.

 Can anyone help with this problem and also explain the principals
 behind what is happening below.

 C:\orionjava -Ddatasource.verbose=true -jar orion.jar
 DataSource logwriter activated...
 jdbc:oracle:thin:@myserver:1521:myInstance: Started
 jdbc:oracle:thin:@myserver:1521:myInstance: Started
 Orion Pooled jdbc:oracle:thin:@myserver:1521:myInstance: Started
 Orion/1.3.8 initialized
 Created new physical connection: XA XA Orion Pooled
 jdbc:oracle:thin:@myserver:1521
 :SATT
 null: Connection XA XA Orion Pooled
 jdbc:oracle:thin:@myserver:1521:myInstance allocated
 (Pool size: 0)
 jdbc:oracle:thin:@myserver:1521:myInstance: Opened connection
 Created new physical connection: Pooled
 oracle.jdbc.driver.OracleConnection@c24c
 0
 Pooled jdbc:oracle:thin:@myserver:1521:SATT: Connection Pooled
 oracle.jdbc.driver.O
 racleConnection@c24c0 allocated (Pool size: 0)
 Pooled jdbc:oracle:thin:@myserver:1521:SATT: Releasing connection
 Pooled oracle.jdb
 c.driver.OracleConnection@c24c0 to pool (Pool size:
 [Ljavax.sql.PooledConnection
 ;@5f8172)
 null: Releasing connection XA XA Orion Pooled
 jdbc:oracle:thin:@myserver:1521:myInstance
 to pool (Pool size: [Ljavax.sql.PooledConnection;@2ba11b)
 Orion Pooled jdbc:oracle:thin:@myserver:1521:myinstance: Cache
 timeout, closing connectio
 n (Pool size: 0)
 jdbc/DefaultEJBDS: Cache timeout, closing connection (Pool size: 0)

 Best regards

 /Theis






JDBC Connection problem

2000-07-26 Thread Ishpal

hello,

I'm new here and trying to setup orion server.
The problem is with the data-souce.xml

My environment is as ...

O.S.-- Linux RedHat-6.2,
JDK-- jdk1.2.2 from Sun 
DataBase-- MySQL.
JDBC driver-- mm.mysql.jdbc-1.2c

In the config/data-sources.xml file My configurations are...

data-source
name="Profile"
class="org.gjt.mm.mysql.Driver"
connection-driver="org.gjt.mm.mysql.Driver"
location="../lib"
url="jdbc:mysql://localhost/test"
username="testusr"
password="testpwd"
/  

I have kept the JDBC-driver's jar file in ../lib directory.

Whenever I try to start the server with

java -jar orion.jar

I get an error as 
Error initializing server: Unknown DataSource type:
org.gjt.mm.mysql.Driver

What is it that I'm doing wrong...??
I dont want to use any other database right now.

Any help would be highly appreciated.

Thanks,
Ishpal.




RE: JDBC Connection problem

2000-07-26 Thread Dave Smith

You have updated the wrong fields.

You need something like

data-source 
name="Profile"
class="com.evermind.sql.ConnectionDataSource"   {DO NOT
CHANGE}
location="jdbc/DefaultDS"
pooled-location="jdbc/DefaultPooledDS"
xa-location="jdbc/xa/DefaultXADS"
ejb-location="jdbc/DefaultEJBDS"
url="jdbc:mysql://localhost/test"
connection-driver="org.gjt.mm.mysql.Driver"
username="testusr"
password="testpwd"
/

Dave Smith
Senior Team Leader
Aristocrat Technologies Australia Pty Ltd

mailto:[EMAIL PROTECTED]


-Original Message-
From: Ishpal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 27 July 2000 13:38
To: Orion-Interest
Subject: JDBC Connection problem


hello,

I'm new here and trying to setup orion server.
The problem is with the data-souce.xml

My environment is as ...

O.S.-- Linux RedHat-6.2,
JDK-- jdk1.2.2 from Sun 
DataBase-- MySQL.
JDBC driver-- mm.mysql.jdbc-1.2c

In the config/data-sources.xml file My configurations are...

data-source
name="Profile"
class="org.gjt.mm.mysql.Driver"
connection-driver="org.gjt.mm.mysql.Driver"
location="../lib"
url="jdbc:mysql://localhost/test"
username="testusr"
password="testpwd"
/  

I have kept the JDBC-driver's jar file in ../lib directory.

Whenever I try to start the server with

java -jar orion.jar

I get an error as 
Error initializing server: Unknown DataSource type:
org.gjt.mm.mysql.Driver

What is it that I'm doing wrong...??
I dont want to use any other database right now.

Any help would be highly appreciated.

Thanks,
Ishpal.




Re: JDBC connection port?

2000-06-06 Thread Joseph B. Ottinger

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Tue, 6 Jun 2000, Y. J. Chun wrote:

 Hi.
 I just installed Orion and enabled specified database-source url like
 following
 url="jdbc:mysql://monac.pe.kr:3306/monac"
 
 but when i try the ejb demo, (cart product)
 it fails reporting
  Cannot connect to MySQL server on localhost:1306
 what i dont understand is that i speficied PORT number in jdbc url but
 it still tries to connect to localhost:1306
 how is it like this?

Any number of reasons for this, but note that MySQL is entirely
inappropriate for use with EJBs due to its lack of transaction
support. Also note that MySQL's planned transaction support goes something
like this: "We don't support them, nor will we ever do so." More
specifically, you probably don't have the security settings for mysql
correctly set up, and you need ALL of the data source attributes set up
(the XA attribute, etc.)

- ---
Joseph B. Ottinger   [EMAIL PROTECTED]
http://cupid.suninternet.com/~joeo  HOMES.COM Developer

-BEGIN PGP SIGNATURE-
Version: PGP 6.5.1i

iQA/AwUBOTya9ghcVZKknQwGEQJl1wCgqSuhGQgD78m5LNYH6Opv+ncgma0AoPRA
NkwX1dEuf8uQGLas17GwVmxM
=TEY3
-END PGP SIGNATURE-





jdbc connection

2000-04-07 Thread bradley mclain

hello,

i have just been moving a small servlet/jsp app i
wrote on nt over to orion on linux (kernel 2.2.14,
blackdown jdk 1.2.2RC4).  everything has gone well,
except i am having some jdbc trouble.

on nt i was using sun.jdbc.odbc, but on linux i wanted
to try a real type 4 driver.  so i got jturbo 2.0 and
went to work.  i have successfully installed the
driver and recompiled my beans/servlets (i know, the
driver name should not be in there, but i'm still
learning).  i have also edited the data-sources.xml
file, although i am not very confident about that. 
when i post a request to my first servlet the app
hangs, cpu utilization shoots to 100 and sits there. 
i eventually have to kill the jvm to get it back.

this app was working perfectly using jdbc:odbc on
nt/iis/jrun.  here is the entry in my data-source.xml
file as it currently stands:

data-source 
name="Nexus"
class="com.evermind.sql.ConnectionDataSource"
location="jdbc/DefaultDS"
pooled-location="jdbc/DefaultPooledDS"
xa-location="jdbc/xa/DefaultXADS"
ejb-location="jdbc/DefaultEJBDS"
url="jdbc:JTurbo:167.246.165.222/nexus/sql70=true"
connection-driver="com.ashna.jturbo.driver.Driver"
username="sa"
password=""
/

can anyone suggest where i may be going wrong or what
may be causing the hanging?

tia,
bradley mclain

__
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com