cancel
Showing results for 
Search instead for 
Did you mean: 

PROBLEM WITH JDBC CONNECTION

Former Member
0 Kudos

Hello All,

I'm working on EP using JAVA programming..,Here i'm using MSSQL and jdbc connection gateway services..

we developed some portal java applications these aplications are using by nearly 300-400 sales officers every day, but the problem here is after 90 processes it reached in MSSQL DB automatically the DB connection is automatically Disconnecting..,

Plz Help me in this problem .. i'm attaching the code also here plz give me a help..,

Thank's inadvance..,

The code as follows

public ArrayList viewDQR( String strDate, String strSalesOfficer, IPortalComponentRequest request)

{

IRecordSet rs = null;

IConnection connection = null;

ArrayList alstResult = new ArrayList();

ArrayList arlParameterInValue = new ArrayList();

arlParameterInValue.add(strDate);

arlParameterInValue.add(strSalesOfficer);

try

{

IConnectorGatewayService cgService = (IConnectorGatewayService)PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);

ConnectionProperties cp = new ConnectionProperties(request.getLocale(),request.getUser());

connection = cgService.getConnection("DBSQL", cp);

IInteraction ix = connection.createInteractionEx();

IInteractionSpec ixspec = ix.getInteractionSpec();

ixspec.setPropertyValue("Name", "DQRView");

RecordFactory rf = ix.getRecordFactory();

IndexedRecord input = rf.createIndexedRecord("input");

for(int k=0;k<arlParameterInValue.size();k++)

{

String strInput = (String) arlParameterInValue.get(k);

input.add(strInput);

}

MappedRecord output = (MappedRecord)ix.execute(ixspec, input);

Object result = output.get("DQRView.@RESULT");

if (result instanceof IRecordSet)

{

rs = (IRecordSet) result;

}

ArrayList alstNotes = new ArrayList();

while (rs.next())

{

String strComments = rs.getString(1);

alstNotes.add(strComments);

}

alstResult.add(alstNotes);

}

catch(NumberFormatException e){

return null;

}catch(NullPointerException e){

return null;

} catch (ExecutionException e) {

return null;

} catch (ConnectorException e) {

return null;

} catch (ResourceException e) {

return null;

} catch (NoLogonDataAvailableException e) {

return null;

}

finally

{

try

{

rs.close();

connection.close();

}

catch(Exception e)

{

e.printStackTrace();

}

}

return alstResult;

}

Accepted Solutions (1)

Accepted Solutions (1)

guru_subramanianb
Active Contributor
0 Kudos

Hi,

probably you have set your connection pooling with your WAS server using Visual Adminstrator to resolve this issue.

Refer this thread for the same.

Regards,

Guru

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello Subramaniyan Garu,

Thanks for reply..,

Actually the problem is i'm logged into portal using the services which are developed in java & MSSQL okay..,

this is of type they can view the data they filled and they can also enter the data for particuklar day..,

I tested like the following , i entered with one login id

and keep on testing the same activity (VIEW) its getting the values from DB .. for every activity it's opening the NEW CONNECTION and ONE NEW PROCESS IS STARTED IN THE MSSQL

SERVER.. AFTER THE TESTING ITS DISCONNECTING AT

101 DB CONNECTIONS and 152 PROCESSS(PROCESSS STARTED AT 51 - 152)

IN MY PREVIOUS CODE THE WAY I'M CLOSING THE CONNECTION IS IT OKAY OR IT'S STILL HOLDING THE RESOURCES..,COULD YOU PLZ VERIFY MY CODE ONE MORE TIME (PLZ...)

IF NOT PLZ GIVE ME SOME STEPS TO FOLLOW..

IMPORTANT NOTE:

IN SERVER IT'S GIVING "NO NEW NATIVE THREAD WILL CREATE"

PLZ GIVE ME A SOLUTION FOR THIS PROBLEM