cancel
Showing results for 
Search instead for 
Did you mean: 

JCO Client Pool

Former Member
0 Kudos

Hi All,

I have a situation where I'm supposed to initialize JCO Client pool at server startup(Weblogic 8.1). Could someone please let me know how to achieve this.

Any pointers to documentation or sample startup servlet code would also be of great help!

Regards,

Chaitanya

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182294
Active Contributor
0 Kudos

Hi Chaitanya,

To achieve this fuctionality you need to :

- Write JCO Pool logic in initt() method servlet.

- Configure the servlet to load on start up. You can do this with following changes in web.xml file:

<servlet>

<servlet-name>Servlet Name</servlet-name>

<servlet-class>com.tst.ServletFile</servlet-class>

<load-on-startup>1</load-on-startup>

</servlet>

Regards

Abhilash

Former Member
0 Kudos

Abhilash,

That was what Im precisely thinking to do. If thats an approved approach then I would follow it.

However, after adding the client pool to the static JCO method JCO.addClientPool() could I retrieve the connection in my backend class? Could you put some light on best way to retrieve the connection object.

Regards,

Chaitanya

former_member182294
Active Contributor
0 Kudos

Chaitanya,

You can always do that by using the same Pool name with JCO.getClient(POOL_KEY) and in the same way you can release it by JCO.releaseClient(client).

The better approach is write your own classe where all JCO related logic is maintained. And use that class to initialilze the pool in servlet and to get connection and release connection.

Regards

Abhilash

Former Member
0 Kudos

Abhilash,

Thank you very much for the prompt response.

<i>The better approach is write your own classe where all JCO related logic is maintained. And use that class to initialilze the pool in servlet and to get connection and release connection.</i>

I couldn't get the gist of this, are we trying to invoke a startup servlet from an external class? My idea is to do as follows:

1. Create a servlet that is intialized on server startup.

2. In the init method initialize JCO client pool.

3. Write a backend class something like <MyApp>BackendR3 and have a getConnection() inside.

My question was, <b>could I directly use JCo.getClient method? in the backend class</b>.

4. If yes, am I supposed to add a JCo jar during weblogic startup explicity or could it simply reside in web-inf/lib

Thanks again,

Chaitanya

Message was edited by:

chaitanya hazari

former_member182294
Active Contributor
0 Kudos

Chaitanya,

You can definetly use the JCO.getClient(POOL_NAME) until unless you applications are running under same JVM.

You can keep sapjco.jar inside the Web-inf/lib or you can keep it in common lib of WebLogic.

Regards

Abhilash

Former Member
0 Kudos

Thank you Abhilash.

Appreciate all your help.

Regards,

Chaitanya