You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Tolsch, Ed" <Ed...@fmr.com> on 2002/05/30 16:57:52 UTC

question on migrating from Soap 2.2 to Axis

HI,
	I'm trying to migrate from a Soap 2.2. mindset to the Axis framework
and I have a question.

In SOAP 2.2 I had control over the init() method in the rpcrouter servlet. I
put a hook in there which setup some database connections and put them in
cache. When my implementation class was invoked I leveraged those cached
connections. Can someone instruct me on the proper way with Axis to perform
this. Thanks in advance.


Ed Tolsch
817.474.9939
ed.tolsch@fmr.com


Re: question on migrating from Soap 2.2 to Axis

Posted by Glen Daniels <gd...@macromedia.com>.
Hi Ed,

Caching resources like db connections is certainly possible in Axis, but we try
where possible to avoid transport level dependencies on things like
HTTP/servlets.  There are several ways you can go about this:

1) Set your service to be "scope='application'", which will share a single
instance of your service object for all requests.  If your service object
implements the "ServiceLifecycle" interface
(javax.xml.rpc.server.ServiceLifecycle), you'll get an "init()" message when
the first call happens, during which you can set up your connection.  Then you
can expect a "destroy()" message when the system shuts down, so you can clean
up in there.

2) If you want multiple instances of your object per-session or per-request,
you can still use the init()/destroy() methods of the ServiceLifecycle
interface on your object to get the DB connection from another source - for
instance, set up a class like this:

public DBCache {
    public static DBConnection getConnection() {...};
    public static void releaseConnection(DBConnection) {...};
}

...then call getConnection() during init() and releaseConneciton() during
destroy() on your object.

Hope this gets you pointed in the right direction...

--Glen

----- Original Message -----
From: "Tolsch, Ed" <Ed...@fmr.com>
To: <ax...@xml.apache.org>
Sent: Thursday, May 30, 2002 10:57 AM
Subject: question on migrating from Soap 2.2 to Axis


> HI,
> I'm trying to migrate from a Soap 2.2. mindset to the Axis framework
> and I have a question.
>
> In SOAP 2.2 I had control over the init() method in the rpcrouter servlet. I
> put a hook in there which setup some database connections and put them in
> cache. When my implementation class was invoked I leveraged those cached
> connections. Can someone instruct me on the proper way with Axis to perform
> this. Thanks in advance.
>
>
> Ed Tolsch
> 817.474.9939
> ed.tolsch@fmr.com
>