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 Benjamin Tomasini <bt...@neteverything.com> on 2003/05/06 03:53:10 UTC

Re: Database Connection pooling & AXIS

Axis is model neutral, so the db connection mechanism is totally up to
you.

I just completed a pretty good sized project using Axis.  My DataBean
used DBCP as the pool.  It works fine.

However, since you are in a web container, you can get a pooled
connection from a JNDI lookup on a DataSource.  I think that is the
better design.

If you unit test outside of the container, you can set a system property
to manually create the connection internally.  This helps run Junit
outside of the servlet container, but still put together a connection.

Ben

On Mon, 2003-05-05 at 22:02, David Chew wrote:
> Hi,
> 
> I am a newbie in using Apache Axis and was wondering if anyone has 
> written a SOAP service using Apache Tomcat's DBCP feature. First, my 
> question is, can it be done and second,  if anyone could provide an 
> example, instructions, and/or pointers on how to do this.
> 
> Thanks a lot in advance and your help is greatly appreciated.
> 
> -David
> 
> 



Re: Database Connection pooling & AXIS

Posted by Benjamin Tomasini <bt...@neteverything.com>.
Axis would not change the example at all.  It is not uncommon to have
difficulty getting this to work, it can take a few tries.  Do you have a
stack trace?

Your code is running in a servlet container (I assume), so the entry
point is JNDI, which is readily available.

A tip:  try the same db code in a servlet and get it to work, then move
the code into axis.

Generally, this involves:

1. In your base DataBean, setting up your DataSource in a static
initializer.

2. Implement your get / open connection routine.

Good luck!

On Tue, 2003-05-06 at 20:57, David Chew wrote:
> Hi Ben,
> 
> Thanks a lot for your reply. Any pointer i.e. books and/or websites on 
> where I could find an example on how to get a pooled connection from a 
> JNDI lookup on a Datasource via Axis. I have looked at the apache 
> tomcat's website but couldn't get their example to work.
> 
> Thanks,
> David
> 
> Benjamin Tomasini wrote:
> 
> >Axis is model neutral, so the db connection mechanism is totally up to
> >you.
> >
> >I just completed a pretty good sized project using Axis.  My DataBean
> >used DBCP as the pool.  It works fine.
> >
> >However, since you are in a web container, you can get a pooled
> >connection from a JNDI lookup on a DataSource.  I think that is the
> >better design.
> >
> >If you unit test outside of the container, you can set a system property
> >to manually create the connection internally.  This helps run Junit
> >outside of the servlet container, but still put together a connection.
> >
> >Ben
> >
> >On Mon, 2003-05-05 at 22:02, David Chew wrote:
> >  
> >
> >>Hi,
> >>
> >>I am a newbie in using Apache Axis and was wondering if anyone has 
> >>written a SOAP service using Apache Tomcat's DBCP feature. First, my 
> >>question is, can it be done and second,  if anyone could provide an 
> >>example, instructions, and/or pointers on how to do this.
> >>
> >>Thanks a lot in advance and your help is greatly appreciated.
> >>
> >>-David
> >>
> >>
> >>    
> >>
> >
> >
> >
> >  
> >
> 
> 



Re: Database Connection pooling & AXIS

Posted by David Chew <da...@earthlink.net>.
Hi Ben,

Thanks a lot for your reply. Any pointer i.e. books and/or websites on 
where I could find an example on how to get a pooled connection from a 
JNDI lookup on a Datasource via Axis. I have looked at the apache 
tomcat's website but couldn't get their example to work.

Thanks,
David

Benjamin Tomasini wrote:

>Axis is model neutral, so the db connection mechanism is totally up to
>you.
>
>I just completed a pretty good sized project using Axis.  My DataBean
>used DBCP as the pool.  It works fine.
>
>However, since you are in a web container, you can get a pooled
>connection from a JNDI lookup on a DataSource.  I think that is the
>better design.
>
>If you unit test outside of the container, you can set a system property
>to manually create the connection internally.  This helps run Junit
>outside of the servlet container, but still put together a connection.
>
>Ben
>
>On Mon, 2003-05-05 at 22:02, David Chew wrote:
>  
>
>>Hi,
>>
>>I am a newbie in using Apache Axis and was wondering if anyone has 
>>written a SOAP service using Apache Tomcat's DBCP feature. First, my 
>>question is, can it be done and second,  if anyone could provide an 
>>example, instructions, and/or pointers on how to do this.
>>
>>Thanks a lot in advance and your help is greatly appreciated.
>>
>>-David
>>
>>
>>    
>>
>
>
>
>  
>