Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Interest »

Re: Connection Pooling doubts..

sankara rao

2003-11-19

Replies:

Hi Alok,

 Find the answers inline.

regards
sankar

Alok_Band wrote:
> Hi,
>
>
>
> I have basic doubts about Connection Pooling,
>
>
>
> Interface DataSource -
>
>     Sun's java doc says that Driver Vendor implement this interface.
>
>
>
> My doubts is who implements Connection Pooling mechanism? Driver Vendor
> or Application Server?
>
   Application Server.

>
>
> What is the use of ConnectionPoolDataSource interface? I read that
> Application Server uses this interface but don't know how?
   ConnectionPoolDataSource is the connection pool enabling infrastructure. To realize that, let us take this piece of code.

     java.sql.Connection conn = ds.getConnection();
      // do some thing with the conn
      conn.close();

      In this case, ConnectionPoolDataSource will inform the Application Server is that, user has called close() on Connection and then AppServer
might decide to pool that connection. If ConnectionPoolDataSource is not available, then instead of the original connection given by the database
driver will be proxied and given to the user.

>
>
>
> I read that JTA enabled JDBC Driver implements XAConnection,
> XADataSource, XAResource interfaces.
>
>
>
> Does it mean that it is the responsibility of Driver Vendor to provide
> ResourceManger(object implementing XAResource) supporting XA/Open
> standard to communicate with Transaction manager?

 From XADataSource, you could get XAConnection and from that you get, XAResource but all that job is appserver's job and you only provide
XADataSource and get and use the connection in the normal way.

>
>
>
> But then what is the use of DataSource interface if JDBC Driver is
> giving XAResource object?
>
>
>
> I have always used DataSource object to get connection. How XAResource
> come in picture? Does it mean that ApplicationServer would internally
> refer to XAResource (given by JDBC Driver) when JTA connection is requested?

Explained above.

>
>
>
> Which one is the Resource Manager for DB DataSource,
> ConnectionPoolDataSource or XAResource? Are there any J2EE specification
> for implementing DB Connection Pool?

 There is no specification for implemneting the connection pool. Basic difference between normal DataSource and ConnectionPoolDataSource is that,
the latter is everything of former plus connection enabling infrastructure. XADataSource is everything of ConnectionPoolDataSource plus the
implementation of XA part.

Please let me know if something is not clear. I try to answer.

>
>
>
> Thanks in Advance
>
>
>
> Regards,
>
> Alok
>
> **************************************************************************
>
> This email (including any attachments) is intended for the sole use of
> the intended recipient/s and may contain material that is CONFIDENTIAL
> AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or
> copying or distribution or forwarding of any or all of the contents in
> this message is STRICTLY PROHIBITED. If you are not the intended
> recipient, please contact the sender by email and delete all copies;
> your cooperation in this regard is appreciated.
>
> **************************************************************************
>
> ===========================================================================
> To unsubscribe, send email to listserv@(protected)
> body of the message "signoff J2EE-INTEREST". For general help, send
> email to listserv@(protected)
> "help".
>


--
Every great movement must experience three stages:
            ridicule, discussion, adoption.

    --    John Stuart Mill

===========================================================================
To unsubscribe, send email to listserv@(protected)
of the message "signoff J2EE-INTEREST". For general help, send email to
listserv@(protected)".


©2008 junlu.com - Jax Systems, LLC, U.S.A.