You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Rafi M M <ra...@hotmail.com> on 2002/08/26 07:59:51 UTC
maintaing single db connection over multiple rpc calls
Hello
I tried to use Apache SOAP rpc call to access the classes(running in a remote server)
which in turn connect to the database and perform the database operations.I deployed the service in a Apache TomCat Server while making the scope as "Session".. It was required to maintain a single database connection for different method invocations for a particular session..The client classes were running in my machine. When testing the thing inside a local network,it worked smoothly without any problems and I could maintain a single database connection variable over different method invocations for a single session.. But when I run the server in a very remote machine, for each rpc method call, the constructor of the server class(which is the deployed service) is called and a new databse connection is made for the session..Thus for each method call within one single session, a new database connection is used...I don't know why it happens..Is it due to session timeout?
I would be great if anyone you can provide a solution to the problem..
regards
Rafi
Re: maintaing single db connection over multiple rpc calls
Posted by Scott Nichol <sn...@scottnichol.com>.
Rafi,
Question: you say the "local" WAN scenario works but the "distant" one does
not. Is this the only time you test with the client and server in different
time zones? Is Tomcat still being used in this scenario?
Reminder: if you can use TcpTunnelGui to capture the request and response
for multiple WAN calls that force the creation of multiple connections, it
would be a very big help in understanding this.
Scott Nichol
----- Original Message -----
From: "Rafi M M" <ra...@hotmail.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Tuesday, August 27, 2002 6:01 AM
Subject: Re: maintaing single db connection over multiple rpc calls
Hello Nicol
About your questions:
1.I used Apache SOAP Version 2.2,TomCat Server 4.0 and Jdk 1.3..
And I would like to elaborate the things...
I am using Castor(Mapping tool) to map my Java Objects to database(which
is DB2)..So I have to initialize a CastorPersistentDatastore
variable(Similar to a database connection variable; let us call this as
"store"; for easiness) for a particular session and this "store" variable
is to be used for multiple method invocations under a single
session..Firstly, we are initializing a rpc call on the client side for a
session.. In the constructor of the server Class we are initializing a
store..Suppose a number of methods are to be invoked within a session using
the single "store".i.e. when we invoke one method for the first time,we are
starting the transaction using the store..
So subsequent method invocations under the same session must be using the
same "store" ... and for the entire session there is only one "store"
variable..
and the scenarios:-
1.The Server and Client machines running in a LAN.:-.No problem occurs
here..and a single "store" is maintained throughout the session...
2.The Server and Client machines are inside a WAN ; but within a local
loop..:- Here also the program runs smoothly..again maintaining a single
"store" variable for the entire session across different method
invocations irrespective of whether the WAN Connection go through a proxy or
not...
3.The Server and Client machines are in remote locations(like Server is
in India and Client is in Germany):- For the first method invocation using
rpc call,the program works, but for the next method call a new "store"
variable is initialized again(I think all the variables of the deployed
Class are initialized again!!)...remember that the transaction is not
committed..It is required that the next method call also use the same old
"store" variable; not the new one initialized... and I have a doubt that it
happens due to the expiry of session..I used the method setTimeOut(0) of the
SOAPHTTPConnection class..but of no use!!!
Here no Proxy is used..
hope you would help to find out a solution..
Thank you very much for the interest shown..
Also thanks to Mark Childerson and Niclas Hedhman ...
regards
Rafi
----- Original Message -----
From: Scott Nichol <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, August 26, 2002 7:15 PM
Subject: Re: maintaing single db connection over multiple rpc calls
> Rafi,
>
> To help investigate this, the following would be useful:
>
> 1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
> and WAN scenarios. Also, does your WAN connection go through a proxy.
> 2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
> to be in a single session in WAN scenario. If you have not used
> TcpTunnelGui before, it is invoked like
>
> java org.apache.soap.util.net.TcpTunnelGui 81 host port
>
> In this case, it would listen on localhost:81 and forward messages to
> host:port. You would point your client to localhost:81, e.g. an endpoint
> URL of http://localhost:81/soap/servlet/rpcrouter.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Rafi M M" <ra...@hotmail.com>
> To: "soap developers" <so...@xml.apache.org>
> Sent: Monday, August 26, 2002 1:59 AM
> Subject: maintaing single db connection over multiple rpc calls
>
>
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
> which in turn connect to the database and perform the database
operations.I
> deployed the service in a Apache TomCat Server while making the scope as
> "Session".. It was required to maintain a single database connection for
> different method invocations for a particular session..The client classes
> were running in my machine. When testing the thing inside a local
network,it
> worked smoothly without any problems and I could maintain a single
database
> connection variable over different method invocations for a single
session..
> But when I run the server in a very remote machine, for each rpc method
> call, the constructor of the server class(which is the deployed service)
is
> called and a new databse connection is made for the session..Thus for each
> method call within one single session, a new database connection is
used...I
> don't know why it happens..Is it due to session timeout?
> I would be great if anyone you can provide a solution to the problem..
>
> regards
> Rafi
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: maintaing single db connection over multiple rpc calls
Posted by Scott Nichol <sn...@scottnichol.com>.
Rafi,
Question: you say the "local" WAN scenario works but the "distant" one does
not. Is this the only time you test with the client and server in different
time zones? Is Tomcat still being used in this scenario?
Reminder: if you can use TcpTunnelGui to capture the request and response
for multiple WAN calls that force the creation of multiple connections, it
would be a very big help in understanding this.
Scott Nichol
----- Original Message -----
From: "Rafi M M" <ra...@hotmail.com>
To: <so...@xml.apache.org>
Cc: <sn...@scottnichol.com>
Sent: Tuesday, August 27, 2002 6:01 AM
Subject: Re: maintaing single db connection over multiple rpc calls
Hello Nicol
About your questions:
1.I used Apache SOAP Version 2.2,TomCat Server 4.0 and Jdk 1.3..
And I would like to elaborate the things...
I am using Castor(Mapping tool) to map my Java Objects to database(which
is DB2)..So I have to initialize a CastorPersistentDatastore
variable(Similar to a database connection variable; let us call this as
"store"; for easiness) for a particular session and this "store" variable
is to be used for multiple method invocations under a single
session..Firstly, we are initializing a rpc call on the client side for a
session.. In the constructor of the server Class we are initializing a
store..Suppose a number of methods are to be invoked within a session using
the single "store".i.e. when we invoke one method for the first time,we are
starting the transaction using the store..
So subsequent method invocations under the same session must be using the
same "store" ... and for the entire session there is only one "store"
variable..
and the scenarios:-
1.The Server and Client machines running in a LAN.:-.No problem occurs
here..and a single "store" is maintained throughout the session...
2.The Server and Client machines are inside a WAN ; but within a local
loop..:- Here also the program runs smoothly..again maintaining a single
"store" variable for the entire session across different method
invocations irrespective of whether the WAN Connection go through a proxy or
not...
3.The Server and Client machines are in remote locations(like Server is
in India and Client is in Germany):- For the first method invocation using
rpc call,the program works, but for the next method call a new "store"
variable is initialized again(I think all the variables of the deployed
Class are initialized again!!)...remember that the transaction is not
committed..It is required that the next method call also use the same old
"store" variable; not the new one initialized... and I have a doubt that it
happens due to the expiry of session..I used the method setTimeOut(0) of the
SOAPHTTPConnection class..but of no use!!!
Here no Proxy is used..
hope you would help to find out a solution..
Thank you very much for the interest shown..
Also thanks to Mark Childerson and Niclas Hedhman ...
regards
Rafi
----- Original Message -----
From: Scott Nichol <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, August 26, 2002 7:15 PM
Subject: Re: maintaing single db connection over multiple rpc calls
> Rafi,
>
> To help investigate this, the following would be useful:
>
> 1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
> and WAN scenarios. Also, does your WAN connection go through a proxy.
> 2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
> to be in a single session in WAN scenario. If you have not used
> TcpTunnelGui before, it is invoked like
>
> java org.apache.soap.util.net.TcpTunnelGui 81 host port
>
> In this case, it would listen on localhost:81 and forward messages to
> host:port. You would point your client to localhost:81, e.g. an endpoint
> URL of http://localhost:81/soap/servlet/rpcrouter.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Rafi M M" <ra...@hotmail.com>
> To: "soap developers" <so...@xml.apache.org>
> Sent: Monday, August 26, 2002 1:59 AM
> Subject: maintaing single db connection over multiple rpc calls
>
>
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
> which in turn connect to the database and perform the database
operations.I
> deployed the service in a Apache TomCat Server while making the scope as
> "Session".. It was required to maintain a single database connection for
> different method invocations for a particular session..The client classes
> were running in my machine. When testing the thing inside a local
network,it
> worked smoothly without any problems and I could maintain a single
database
> connection variable over different method invocations for a single
session..
> But when I run the server in a very remote machine, for each rpc method
> call, the constructor of the server class(which is the deployed service)
is
> called and a new databse connection is made for the session..Thus for each
> method call within one single session, a new database connection is
used...I
> don't know why it happens..Is it due to session timeout?
> I would be great if anyone you can provide a solution to the problem..
>
> regards
> Rafi
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: maintaing single db connection over multiple rpc calls
Posted by Rafi M M <ra...@hotmail.com>.
Hello Nicol
About your questions:
1.I used Apache SOAP Version 2.2,TomCat Server 4.0 and Jdk 1.3..
And I would like to elaborate the things...
I am using Castor(Mapping tool) to map my Java Objects to database(which
is DB2)..So I have to initialize a CastorPersistentDatastore
variable(Similar to a database connection variable; let us call this as
"store"; for easiness) for a particular session and this "store" variable
is to be used for multiple method invocations under a single
session..Firstly, we are initializing a rpc call on the client side for a
session.. In the constructor of the server Class we are initializing a
store..Suppose a number of methods are to be invoked within a session using
the single "store".i.e. when we invoke one method for the first time,we are
starting the transaction using the store..
So subsequent method invocations under the same session must be using the
same "store" ... and for the entire session there is only one "store"
variable..
and the scenarios:-
1.The Server and Client machines running in a LAN.:-.No problem occurs
here..and a single "store" is maintained throughout the session...
2.The Server and Client machines are inside a WAN ; but within a local
loop..:- Here also the program runs smoothly..again maintaining a single
"store" variable for the entire session across different method
invocations irrespective of whether the WAN Connection go through a proxy or
not...
3.The Server and Client machines are in remote locations(like Server is
in India and Client is in Germany):- For the first method invocation using
rpc call,the program works, but for the next method call a new "store"
variable is initialized again(I think all the variables of the deployed
Class are initialized again!!)...remember that the transaction is not
committed..It is required that the next method call also use the same old
"store" variable; not the new one initialized... and I have a doubt that it
happens due to the expiry of session..I used the method setTimeOut(0) of the
SOAPHTTPConnection class..but of no use!!!
Here no Proxy is used..
hope you would help to find out a solution..
Thank you very much for the interest shown..
Also thanks to Mark Childerson and Niclas Hedhman ...
regards
Rafi
----- Original Message -----
From: Scott Nichol <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, August 26, 2002 7:15 PM
Subject: Re: maintaing single db connection over multiple rpc calls
> Rafi,
>
> To help investigate this, the following would be useful:
>
> 1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
> and WAN scenarios. Also, does your WAN connection go through a proxy.
> 2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
> to be in a single session in WAN scenario. If you have not used
> TcpTunnelGui before, it is invoked like
>
> java org.apache.soap.util.net.TcpTunnelGui 81 host port
>
> In this case, it would listen on localhost:81 and forward messages to
> host:port. You would point your client to localhost:81, e.g. an endpoint
> URL of http://localhost:81/soap/servlet/rpcrouter.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Rafi M M" <ra...@hotmail.com>
> To: "soap developers" <so...@xml.apache.org>
> Sent: Monday, August 26, 2002 1:59 AM
> Subject: maintaing single db connection over multiple rpc calls
>
>
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
> which in turn connect to the database and perform the database
operations.I
> deployed the service in a Apache TomCat Server while making the scope as
> "Session".. It was required to maintain a single database connection for
> different method invocations for a particular session..The client classes
> were running in my machine. When testing the thing inside a local
network,it
> worked smoothly without any problems and I could maintain a single
database
> connection variable over different method invocations for a single
session..
> But when I run the server in a very remote machine, for each rpc method
> call, the constructor of the server class(which is the deployed service)
is
> called and a new databse connection is made for the session..Thus for each
> method call within one single session, a new database connection is
used...I
> don't know why it happens..Is it due to session timeout?
> I would be great if anyone you can provide a solution to the problem..
>
> regards
> Rafi
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: maintaing single db connection over multiple rpc calls
Posted by Rafi M M <ra...@hotmail.com>.
Hello Nicol
About your questions:
1.I used Apache SOAP Version 2.2,TomCat Server 4.0 and Jdk 1.3..
And I would like to elaborate the things...
I am using Castor(Mapping tool) to map my Java Objects to database(which
is DB2)..So I have to initialize a CastorPersistentDatastore
variable(Similar to a database connection variable; let us call this as
"store"; for easiness) for a particular session and this "store" variable
is to be used for multiple method invocations under a single
session..Firstly, we are initializing a rpc call on the client side for a
session.. In the constructor of the server Class we are initializing a
store..Suppose a number of methods are to be invoked within a session using
the single "store".i.e. when we invoke one method for the first time,we are
starting the transaction using the store..
So subsequent method invocations under the same session must be using the
same "store" ... and for the entire session there is only one "store"
variable..
and the scenarios:-
1.The Server and Client machines running in a LAN.:-.No problem occurs
here..and a single "store" is maintained throughout the session...
2.The Server and Client machines are inside a WAN ; but within a local
loop..:- Here also the program runs smoothly..again maintaining a single
"store" variable for the entire session across different method
invocations irrespective of whether the WAN Connection go through a proxy or
not...
3.The Server and Client machines are in remote locations(like Server is
in India and Client is in Germany):- For the first method invocation using
rpc call,the program works, but for the next method call a new "store"
variable is initialized again(I think all the variables of the deployed
Class are initialized again!!)...remember that the transaction is not
committed..It is required that the next method call also use the same old
"store" variable; not the new one initialized... and I have a doubt that it
happens due to the expiry of session..I used the method setTimeOut(0) of the
SOAPHTTPConnection class..but of no use!!!
Here no Proxy is used..
hope you would help to find out a solution..
Thank you very much for the interest shown..
Also thanks to Mark Childerson and Niclas Hedhman ...
regards
Rafi
----- Original Message -----
From: Scott Nichol <sn...@scottnichol.com>
To: <so...@xml.apache.org>
Sent: Monday, August 26, 2002 7:15 PM
Subject: Re: maintaing single db connection over multiple rpc calls
> Rafi,
>
> To help investigate this, the following would be useful:
>
> 1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
> and WAN scenarios. Also, does your WAN connection go through a proxy.
> 2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
> to be in a single session in WAN scenario. If you have not used
> TcpTunnelGui before, it is invoked like
>
> java org.apache.soap.util.net.TcpTunnelGui 81 host port
>
> In this case, it would listen on localhost:81 and forward messages to
> host:port. You would point your client to localhost:81, e.g. an endpoint
> URL of http://localhost:81/soap/servlet/rpcrouter.
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Rafi M M" <ra...@hotmail.com>
> To: "soap developers" <so...@xml.apache.org>
> Sent: Monday, August 26, 2002 1:59 AM
> Subject: maintaing single db connection over multiple rpc calls
>
>
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
> which in turn connect to the database and perform the database
operations.I
> deployed the service in a Apache TomCat Server while making the scope as
> "Session".. It was required to maintain a single database connection for
> different method invocations for a particular session..The client classes
> were running in my machine. When testing the thing inside a local
network,it
> worked smoothly without any problems and I could maintain a single
database
> connection variable over different method invocations for a single
session..
> But when I run the server in a very remote machine, for each rpc method
> call, the constructor of the server class(which is the deployed service)
is
> called and a new databse connection is made for the session..Thus for each
> method call within one single session, a new database connection is
used...I
> don't know why it happens..Is it due to session timeout?
> I would be great if anyone you can provide a solution to the problem..
>
> regards
> Rafi
>
>
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
Re: maintaing single db connection over multiple rpc calls
Posted by Scott Nichol <sn...@scottnichol.com>.
Rafi,
To help investigate this, the following would be useful:
1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
and WAN scenarios. Also, does your WAN connection go through a proxy.
2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
to be in a single session in WAN scenario. If you have not used
TcpTunnelGui before, it is invoked like
java org.apache.soap.util.net.TcpTunnelGui 81 host port
In this case, it would listen on localhost:81 and forward messages to
host:port. You would point your client to localhost:81, e.g. an endpoint
URL of http://localhost:81/soap/servlet/rpcrouter.
Scott Nichol
----- Original Message -----
From: "Rafi M M" <ra...@hotmail.com>
To: "soap developers" <so...@xml.apache.org>
Sent: Monday, August 26, 2002 1:59 AM
Subject: maintaing single db connection over multiple rpc calls
Hello
I tried to use Apache SOAP rpc call to access the classes(running in a
remote server)
which in turn connect to the database and perform the database operations.I
deployed the service in a Apache TomCat Server while making the scope as
"Session".. It was required to maintain a single database connection for
different method invocations for a particular session..The client classes
were running in my machine. When testing the thing inside a local network,it
worked smoothly without any problems and I could maintain a single database
connection variable over different method invocations for a single session..
But when I run the server in a very remote machine, for each rpc method
call, the constructor of the server class(which is the deployed service) is
called and a new databse connection is made for the session..Thus for each
method call within one single session, a new database connection is used...I
don't know why it happens..Is it due to session timeout?
I would be great if anyone you can provide a solution to the problem..
regards
Rafi
Re: maintaing single db connection over multiple rpc calls
Posted by Niclas Hedhman <ni...@ewarna.com>.
We also have _some_ problem with SOAP Sessions, which are terminated a little
bit by random. Even if we keep doing a dummy call every now and so often
(1min), it happens that a new session is created.
This is leading us to not trust Session, and are planning to introduce our own
session handling on top of SOAP instead of under SOAP.
This will also have the benefit that we control the time out, and can choose
to have it to hours and/or days, letting people completely shutdown their
system and come back later.
Niclas
On Monday 26 August 2002 13:59, Rafi M M wrote:
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server) which in turn connect to the database and perform the
> database operations.I deployed the service in a Apache TomCat Server while
> making the scope as "Session".. It was required to maintain a single
> database connection for different method invocations for a particular
> session..The client classes were running in my machine. When testing the
> thing inside a local network,it worked smoothly without any problems and I
> could maintain a single database connection variable over different method
> invocations for a single session.. But when I run the server in a very
> remote machine, for each rpc method call, the constructor of the server
> class(which is the deployed service) is called and a new databse connection
> is made for the session..Thus for each method call within one single
> session, a new database connection is used...I don't know why it
> happens..Is it due to session timeout? I would be great if anyone you can
> provide a solution to the problem..
>
> regards
> Rafi
Re: maintaing single db connection over multiple rpc calls
Posted by Niclas Hedhman <ni...@ewarna.com>.
We also have _some_ problem with SOAP Sessions, which are terminated a little
bit by random. Even if we keep doing a dummy call every now and so often
(1min), it happens that a new session is created.
This is leading us to not trust Session, and are planning to introduce our own
session handling on top of SOAP instead of under SOAP.
This will also have the benefit that we control the time out, and can choose
to have it to hours and/or days, letting people completely shutdown their
system and come back later.
Niclas
On Monday 26 August 2002 13:59, Rafi M M wrote:
> Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server) which in turn connect to the database and perform the
> database operations.I deployed the service in a Apache TomCat Server while
> making the scope as "Session".. It was required to maintain a single
> database connection for different method invocations for a particular
> session..The client classes were running in my machine. When testing the
> thing inside a local network,it worked smoothly without any problems and I
> could maintain a single database connection variable over different method
> invocations for a single session.. But when I run the server in a very
> remote machine, for each rpc method call, the constructor of the server
> class(which is the deployed service) is called and a new databse connection
> is made for the session..Thus for each method call within one single
> session, a new database connection is used...I don't know why it
> happens..Is it due to session timeout? I would be great if anyone you can
> provide a solution to the problem..
>
> regards
> Rafi
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: maintaing single db connection over multiple rpc calls
Posted by Scott Nichol <sn...@scottnichol.com>.
Rafi,
To help investigate this, the following would be useful:
1. Versions of software used (Apache SOAP, Tomcat, JVM, etc.) for both LAN
and WAN scenarios. Also, does your WAN connection go through a proxy.
2. Capture (e.g. using TcpTunnelGui) of a pair of messages that you expect
to be in a single session in WAN scenario. If you have not used
TcpTunnelGui before, it is invoked like
java org.apache.soap.util.net.TcpTunnelGui 81 host port
In this case, it would listen on localhost:81 and forward messages to
host:port. You would point your client to localhost:81, e.g. an endpoint
URL of http://localhost:81/soap/servlet/rpcrouter.
Scott Nichol
----- Original Message -----
From: "Rafi M M" <ra...@hotmail.com>
To: "soap developers" <so...@xml.apache.org>
Sent: Monday, August 26, 2002 1:59 AM
Subject: maintaing single db connection over multiple rpc calls
Hello
I tried to use Apache SOAP rpc call to access the classes(running in a
remote server)
which in turn connect to the database and perform the database operations.I
deployed the service in a Apache TomCat Server while making the scope as
"Session".. It was required to maintain a single database connection for
different method invocations for a particular session..The client classes
were running in my machine. When testing the thing inside a local network,it
worked smoothly without any problems and I could maintain a single database
connection variable over different method invocations for a single session..
But when I run the server in a very remote machine, for each rpc method
call, the constructor of the server class(which is the deployed service) is
called and a new databse connection is made for the session..Thus for each
method call within one single session, a new database connection is used...I
don't know why it happens..Is it due to session timeout?
I would be great if anyone you can provide a solution to the problem..
regards
Rafi
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>
Re: maintaing single db connection over multiple rpc calls
Posted by Mark Childerson <ma...@childersoft.com>.
I had some trouble with the session scope of soap calls myself, so what I
did was create a Singleton class to hold a pool of database connections.
The SOAP server then runs with request scope and gets a connection from the
pool. As well as solving the immediate problem, connection pooling like
this confers a number of performance and scalability advantages.
Mark
At 11:29 AM 26/08/2002 +0530, you wrote:
>Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
>which in turn connect to the database and perform the database
>operations.I deployed the service in a Apache TomCat Server while making
>the scope as "Session".. It was required to maintain a single database
>connection for different method invocations for a particular session..The
>client classes were running in my machine. When testing the thing inside a
>local network,it worked smoothly without any problems and I could maintain
>a single database connection variable over different method invocations
>for a single session.. But when I run the server in a very remote machine,
>for each rpc method call, the constructor of the server class(which is the
>deployed service) is called and a new databse connection is made for the
>session..Thus for each method call within one single session, a new
>database connection is used...I don't know why it happens..Is it due to
>session timeout?
>I would be great if anyone you can provide a solution to the problem..
>
>regards
>Rafi
Re: maintaing single db connection over multiple rpc calls
Posted by Mark Childerson <ma...@childersoft.com>.
I had some trouble with the session scope of soap calls myself, so what I
did was create a Singleton class to hold a pool of database connections.
The SOAP server then runs with request scope and gets a connection from the
pool. As well as solving the immediate problem, connection pooling like
this confers a number of performance and scalability advantages.
Mark
At 11:29 AM 26/08/2002 +0530, you wrote:
>Hello
> I tried to use Apache SOAP rpc call to access the classes(running in a
> remote server)
>which in turn connect to the database and perform the database
>operations.I deployed the service in a Apache TomCat Server while making
>the scope as "Session".. It was required to maintain a single database
>connection for different method invocations for a particular session..The
>client classes were running in my machine. When testing the thing inside a
>local network,it worked smoothly without any problems and I could maintain
>a single database connection variable over different method invocations
>for a single session.. But when I run the server in a very remote machine,
>for each rpc method call, the constructor of the server class(which is the
>deployed service) is called and a new databse connection is made for the
>session..Thus for each method call within one single session, a new
>database connection is used...I don't know why it happens..Is it due to
>session timeout?
>I would be great if anyone you can provide a solution to the problem..
>
>regards
>Rafi