|
Re: DB2 connections [message #742582 is a reply to message #742553] |
Thu, 20 October 2011 16:13 |
|
Marc,
It should be doing this by default, but you could try adding the
following to the beforeOpen script of the datasource:
reportContext.getAppContext().put("OdaJDBCDriverPassInConnectionCloseAfterUse",
true);
Jason
On 10/20/2011 11:45 AM, marc.marshall wrote:
> 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 16:48 |
|
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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03324 seconds