Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » DB2 connections
DB2 connections [message #742553] Thu, 20 October 2011 15:45 Go to next message
marc.marshall is currently offline marc.marshallFriend
Messages: 30
Registered: June 2011
Member
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 #742582 is a reply to message #742553] Thu, 20 October 2011 16:13 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 #742601 is a reply to message #742582] Thu, 20 October 2011 16:37 Go to previous messageGo to next message
marc.marshall is currently offline marc.marshallFriend
Messages: 30
Registered: June 2011
Member
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 #742609 is a reply to message #742601] Thu, 20 October 2011 16:48 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

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 18:15 Go to previous message
marc.marshall is currently offline marc.marshallFriend
Messages: 30
Registered: June 2011
Member
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
Previous Topic:Paginate on Y-Series Group?
Next Topic:BIRT Report Engine Installation Problem
Goto Forum:
  


Current Time: Sun Dec 21 13:45:22 GMT 2014

Powered by FUDForum. Page generated in 0.07280 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software