on 12-19-2006 6:25 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.