james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Labib Iskander, Marcus" <...@cm-ag.de>
Subject RE: max db connection problem
Date Fri, 31 May 2002 16:48:18 GMT
Hi all,
I think I know where the bug is:
everytime getUserByName() is called a new PreparedStatement is created but
since the Connection is pooled and not really closed these get not collected
fast enough. Every PreparedStatement Object has a SQL cursor in the Oracle
session bound to the connection. Thus the max number of open cursors is
exceeded.
In lightweigt DBs like MySql PreparedStatements don't consume Server
resources, but an Oracle PreparedStatement is optimized to be called
repeatedly. These should be closed explicitly or pooled with the connection
(what is not trivial).

Cheers,
  Marcus

> -----Original Message-----
> From: Samuel Sadek [mailto:samuel_sadek@hotmail.com]
> Sent: Friday, May 31, 2002 6:09 PM
> To: james-user@jakarta.apache.org
> Subject: max db connection problem
> 
> 
> Hi all,
> 
> I have been testing James to see how it handles multiple db 
> connections to 
> my user mail db repository. Apparently, after 10-20 
> simultaneous connections 
> made to James, it apparently goes into an infinite loop and 
> resources are 
> fully consumed as a result. I have set the <max>0</max> 
> parameter to 0 to 
> handle an unlimited amount of simultaneous connections. I 
> thought that the 
> last patch made helped eradicate this problem but it 
> apparently it has not.
> 
> I also submit the stack trace:
> 
> java.sql.SQLException: ORA-01000: maximum open cursors exceeded
> 
>         at 
> oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
>         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
>         at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
>         at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:466)
>         at 
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:413)
>         at 
> oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:432)
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedState
> ment.java:182)
>         at 
> oracle.jdbc.driver.OraclePreparedStatement.<init>(OraclePreparedState
> ment.java:165)
>         at 
> oracle.jdbc.driver.OracleConnection.privatePrepareStatement(OracleCon
> nection.java:608)
>         at 
> oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection
> .java:489)
>         at 
> org.apache.james.util.mordred.PoolConnEntry.prepareStatement(PoolConn
> Entry.java:219)
>         at 
> org.apache.james.userrepository.AbstractJdbcUsersRepository.getUserBy
> Name(AbstractJdbcUsersRepository.java:408)
>         at 
> org.apache.james.userrepository.AbstractUsersRepository.test(Abstract
> UsersRepository.java:263)
>         at 
> org.apache.james.imapserver.commands.LoginCommand.doProcess(LoginComm
> and.java:34)
>         at 
> org.apache.james.imapserver.commands.CommandTemplate.process(CommandT
> emplate.java:81)
>         at 
> org.apache.james.imapserver.SingleThreadedConnectionHandler.parseComm
> and(SingleThreadedConnectionHandler.java:346)
>         at 
> org.apache.james.imapserver.SingleThreadedConnectionHandler.handleCon
> nection(SingleThreadedConnectionHandler.java:192)
>         at 
> org.apache.avalon.cornerstone.blocks.connection.ConnectionRunner.run(
> Connection.java:167)
>         at 
> org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Ex
> ecutableRunnable.java:47)
>         at 
> org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread
> .java:86)
> org.apache.avalon.framework.CascadingRuntimeException: Error 
> accessing 
> database
>         at 
> org.apache.james.userrepository.AbstractJdbcUsersRepository.getUserBy
> Name(AbstractJdbcUsersRepository.java:434)
>         at 
> org.apache.james.userrepository.AbstractUsersRepository.test(Abstract
> UsersRepository.java:263)
>         at 
> org.apache.james.imapserver.commands.LoginCommand.doProcess(LoginComm
> and.java:34)
>         at 
> org.apache.james.imapserver.commands.CommandTemplate.process(CommandT
> emplate.java:81)
>         at 
> org.apache.james.imapserver.SingleThreadedConnectionHandler.parseComm
> and(SingleThreadedConnectionHandler.java:346)
>         at 
> org.apache.james.imapserver.SingleThreadedConnectionHandler.handleCon
> nection(SingleThreadedConnectionHandler.java:192)
>         at 
> org.apache.avalon.cornerstone.blocks.connection.ConnectionRunner.run(
> Connection.java:167)
>         at 
> org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Ex
> ecutableRunnable.java:47)
>         at 
> org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread
> .java:86)
> 
> I would appreciate any information regarding this matter.
> 
> Thanks in advance.
> 
> Sam.
> 
> 
> _________________________________________________________________
> Chat with friends online, try MSN Messenger: http://messenger.msn.com
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:james-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:james-user-help@jakarta.apache.org>
> 

--
To unsubscribe, e-mail:   <mailto:james-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@jakarta.apache.org>


Mime
View raw message