I am only doing transactions when I do a write.. currently I don't have begin and end 
transactions on database reads. Also I don't do a t.close, I do a broker.commit() or 
broker.abortTransaction(). I don't call close on the broker until I'm totally done 
with it. Also after chatting with the inetsoftware.de folks for a bit, they think OJB 
isn't returning connections a fast as it asks, causing weird behavior. It could be 
that the validation code isn't removing connections from the pool or something else. I 
will try to make a test case for this as well.

I've noticed this problem since I have to edit OJB.properties to whenExhaustedAction=2 
or I'll get connection errors pretty quick (even though I have maxActive set to 100!)

I don't think the problem is in the ConnectionFactoryPooledImpl either, since I write 
my own implementation that has the same exact problem (I'll send the code over if 
anyone cares to have it - it uses the inetsoftware PoolManager class wrappered for 
OJB). If I set the connection limit to something like 10 (seems reasonable), I run out 
of connections right away, even with mild load on my development box. It seems like 
the connection closed problem is related to this, almost like thrown away connections 
are getting back into the pool after connection.close() was called on them.



Perhaps this is fixed in 1.0rc1, or maybe it's a combination of these settings
maxActive=100
maxIdle=-1
maxWait=2000
timeBetweenEvictionRunsMillis=-1
minEvictableIdleTimeMillis=1000000
whenExhaustedAction=2
ConnectionFactoryClass=org.apache.ojb.broker.accesslayer.ConnectionFactoryPooledImpl


More to come...

Ryan

-----Original Message-----
From: Emmanuel Dupont [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 25, 2003 1:37 AM
To: 'OJB Users List'
Subject: RE : Network error- Socket closed

I noticed that these errors disapeared when I put the request inside  :
t.begin() and t.close().

Is it because we have to put the request inside a transaction ?

My settings are :

SQLServer with JSQLConnect driver and net.sourceforge.jtds.jdbc.Driver. With
both I have the problem...

As you say, it is really weird. Did you try inside a begin/close transaction
and without ?




-----Message d'origine-----
De�: Ryan Vanderwerf [mailto:[EMAIL PROTECTED] 
Envoy�: lundi 24 mars 2003 20:53
��: OJB Users List
Objet�: RE: Network error- Socket closed

I too get these errors quite a bit. It looks like you are using SQL
server, I am also. I am using the Opta2000 driver (commercial) from
inetsoftware.de, and right now I've found best results using their
pooled driver, turning off OJB's connection pool. I'm still trying to
unravel this mystery, it seems to happen on multiple environments, and
the only common element is OJB. What's weirder if I use the Opta Plexa
driver connection manager instead of OJB's (I wrote a OJB plugin
Connection Factory) the errors manifest as 'Connection timed out while
logging in' instead of the opposed 'Connection is closed' messages. I'm
quite confused as to what is going on.

What are your settings?

Ryan

-----Original Message-----
From: Emmanuel Dupont [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 24, 2003 4:48 AM
To: OJB Users List
Subject: Network error- Socket closed

All,

 

I'm playing with Ojb and the Kategorien/Artikel tutorial. I noticed that
when I ask 3 times the same request to the database, I have this error
below.

 

Why it is not possible to request more than3 time the same request to
the
database? ???

 

 

java.sql.SQLException: Network error-  Socket closed

      at net.sourceforge.jtds.jdbc.Tds.executeProcedure(Unknown Source)

      at net.sourceforge.jtds.jdbc.TdsStatement.executeCallImpl(Unknown
Source)

      at
net.sourceforge.jtds.jdbc.TdsStatement.internalExecuteCall(Unknown
Source)

      at
net.sourceforge.jtds.jdbc.PreparedStatement_base.execute(Unknown
Source)

      at
net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(Unknown
Source)

      at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeQuery(JdbcAccess
Impl
.java:259)[org.apache.ojb.broker.accesslayer.JdbcAccessImpl] ERROR:
SQLException during the execution of the query (for a
com.jware.test.ojb.Fournisseur): Network error-  Socket closed

Network error-  Socket closed

 

      at
org.apache.ojb.broker.accesslayer.RsIterator.<init>(RsIterator.java:175)

      at
org.apache.ojb.broker.singlevm.RsIteratorFactoryImpl.createRsIterator(Rs
Iter
atorFactoryImpl.java:95)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getRsIteratorFromQu
ery(
PersistenceBrokerImpl.java:2215)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getIteratorFromQuer
y(Pe
rsistenceBrokerImpl.java:1613)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(Pe
rsistenceBrokerImpl.java:1255)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(Pe
rsistenceBrokerImpl.java:1406)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(Pe
rsistenceBrokerImpl.java:1452)

      at
org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.getCollectionByQuer
y(Pe
rsistenceBrokerImpl.java:1439)

      at
org.apache.ojb.broker.singlevm.DelegatingPersistenceBroker.getCollection
ByQu
ery(DelegatingPersistenceBroker.java:310)

      at com.jware.test.ojb.UCEditTest.apply(UCEditTest.java:42)

      at com.jware.test.ojb.Application.run(Application.java:122)

      at com.jware.test.ojb.Application.main(Application.java:93)

java.sql.SQLException: Network error-  Socket closed

 

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to