cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment Issue with MDM Java API exposed as Webservice using EJBS

Former Member
0 Kudos

Hi Experts,

I am implementing MDM Java APIS in Stateless session bean.Exposed that bean as Webservice and using that webservice in

Webdynpro through Adaptive Webservice Model.

I am facing following issue:

Webservice works fine after deployment,after some number of execution webservice stops working and gives exception.After

Redeployment of the Webservice, it starts working again works fine some number of execution.

I am Using new MDMJava API.

MDM Server Details: MDM 5.5 SP06

I am using following code for connetion

//////////////*************Getting Connection************///////

ConnectionPool pool = null;

String sessionId = null;

try {

pool = ConnectionPoolFactory.getInstance("Server Ip");

} catch (ConnectionException e1) {

System.out.println(e1.getMessage());

}

//////////////*************Repository Session************///////

CreateRepositorySessionCommand repSeession =

new CreateRepositorySessionCommand(p_pool);

repSeession.setRepositoryIdentifier(p_repId);

try {

repSeession.execute();

} catch (CommandException e2) {

System.out.println(e2.getMessage().toString());

}

String repIID = repSeession.getRepositorySession();

// Authenticate Repository

AuthenticateRepositorySessionCommand autRepSeesion =

new AuthenticateRepositorySessionCommand(p_pool);

try {

autRepSeesion.setSession(repSeession.getRepositorySession());

autRepSeesion.setUserName(p_user);

autRepSeesion.setUserPassword(p_Password);

autRepSeesion.execute();

} catch (CommandException e3) {

System.out.println(

"RepSession Seesion" + e3.getMessage().toString());

}

return autRepSeesion.getSession();

//////////////*************user Session************///////

GetRepositoryRegionListCommand regionListCommand =

new GetRepositoryRegionListCommand(p_pool);

regionListCommand.setRepositoryIdentifier(p_repId);

try {

regionListCommand.execute();

} catch (CommandException e) {

System.out.println(e.getMessage().toString());

}

RegionProperties[] regions = regionListCommand.getRegions();

// create a user session

CreateUserSessionCommand UsersessionCommand =

new CreateUserSessionCommand(p_pool);

UsersessionCommand.setRepositoryIdentifier(p_repId);

UsersessionCommand.setDataRegion(regions[0]);

// use the first region

try {

UsersessionCommand.execute();

} catch (CommandException e) {

System.out.println("UserSession" + e.getMessage().toString());

}

String UsersessionId2 = UsersessionCommand.getUserSession();

AuthenticateUserSessionCommand authUserCommand =

new AuthenticateUserSessionCommand(p_pool);

authUserCommand.setSession(UsersessionCommand.getUserSession());

authUserCommand.setUserName(p_userId);

authUserCommand.setUserPassword(p_password);

try {

authUserCommand.execute();

} catch (CommandException e) {

System.out.println("User Seesion" + e.getMessage().toString());

}

return authUserCommand.getSession();

//////////////*************Destroy Session************///////

DestroySessionCommand destroySessionCommand =

new DestroySessionCommand(p_pool);

destroySessionCommand.setSession(p_repsession);

try {

destroySessionCommand.execute();

} catch (CommandException e) {

e.printStackTrace();

}

destroySessionCommand.setSession(p_Uesrsession);

try {

destroySessionCommand.execute();

} catch (CommandException e) {

e.printStackTrace();

}

Do we need to relase the connection pool object also?

Can anyone help me with the code how that can be achived?

Please Reply if anyone has come accross similar issue or know what can be the solution.

Thanks in Advance.

Regards Shruti

Edited by: Shruti Shah on Dec 18, 2008 12:52 PM

Accepted Solutions (1)

Accepted Solutions (1)

nitin_mahajan2
Contributor
0 Kudos

Connection Pool settings on webservice host should be the culprit here.

and/or, it may also depend on how are you calling your destroy connection command. There are chances that the code may not be getting called at all. do cross verify that.

You may also want to check MDM console Admin to see if the connections are getting closed there or not?

if not, i did read in some posts that MDM 5.5 SP6 Patch3 comes with property to kill unstable connections on MDM server.

Good Luck.

~Nitin

**Ignore the other blank message

Former Member
0 Kudos

Hi Nitin,

Thanks for the prompt Response.

Even I am guessing that its becose of Connection pool.

I am destroying session as follows

DestroySessionCommand destroySessionCommand =

new DestroySessionCommand(p_pool);

destroySessionCommand.setSession(p_repsession);

try {

destroySessionCommand.execute();

} catch (CommandException e) {

e.printStackTrace();

}

destroySessionCommand.setSession(p_Uesrsession);

try {

destroySessionCommand.execute();

} catch (CommandException e) {

e.printStackTrace();

}

But I didnot find any method by which i can close realsse connection from connection pool.

It would be great if you can help me how close or realese those connection.In MDM Console i am able to see those sessions even after destroying them.

Regards Shruti.

Answers (1)

Answers (1)

Former Member
0 Kudos

...

Edited by: Nitin Mahajan on Dec 18, 2008 7:26 PM