DB2 connections [message #742553] |
Thu, 20 October 2011 11:45  |
Eclipse User |
|
|
|
Hi,
I have a Birt project that I load my DataSource with a JNDI connection. Birt opens and closes my DB2 connection. When I stress test this report I have found that the DB2 connections are left open and my server locks up when too many of them are opened at once (40). Is there a way to manually force close my DB2 connection after my information is fetched from DB2? Thanks in advance for any advice that you may offer me.
Thanks,
Marc
|
|
|
|
|
Re: DB2 connections [message #742609 is a reply to message #742601] |
Thu, 20 October 2011 12:48   |
Eclipse User |
|
|
|
Here is the code for the close:
public void close( ) throws OdaException
{
logger.logp( java.util.logging.Level.FINEST,
Connection.class.getName( ),
"close", //$NON-NLS-1$
"Connection closed." ); //$NON-NLS-1$
if ( jdbcConn == null )
{
return;
}
try
{
if ( this.appContext != null && jdbcConn != null )
{
Object option = this.appContext.get(
IConnectionFactory.CLOSE_PASS_IN_CONNECTION );
boolean closePassInConnection = ( option instanceof Boolean )
? ( (Boolean) option ).booleanValue( ) : true;
if ( !closePassInConnection )
return;
}
if ( jdbcConn.isClosed( ) == false )
{
jdbcConn.close( );
logger.log(Level.FINER, "JDBC connection: " + jdbcConn + " is closed");
}
else
{
logger.log(Level.FINER, "JDBC connection: " + jdbcConn + " is
already closed outside of JDBC ODA driver");
}
}
catch ( SQLException e )
{
try
{
if (DBConfig.getInstance().qualifyPolicy(
jdbcConn.getMetaData().getDriverName(),
DBConfig.IGNORE_UNIMPORTANT_EXCEPTION))
return;
}
catch (SQLException e1) {
}
throw new JDBCException( ResourceConstants.CONN_CANNOT_CLOSE, e );
}
jdbcConn = null;
}
Set the log level to FINEST and verify the connection is getting closed.
Jason
On 10/20/2011 12:37 PM, marc.marshall wrote:
> Jason,
>
> Does Birt close it logically or close it physically? What I mean
> logically is returning the connection to the pool. At what point Does
> Birt close the DB2 connection? Thank in advance for your advise.
>
> Thanks,
>
> Marc
>
|
|
|
Re: DB2 connections [message #753315 is a reply to message #742609] |
Wed, 26 October 2011 14:15  |
Eclipse User |
|
|
|
Jason,
Thanks for your suggestions. I set viewer log level to finest in my web.xml in my Birt Viewer 2.6.2. I looked in the ReportEngine logs in my Birt Viewer and did not find any open or close logs. Am I using and looking at the correct logs?
Thanks,
Marc
|
|
|
Powered by
FUDForum. Page generated in 0.25206 seconds