Hi Mark -

Regarding:
>Depends on the connection pool and how it's configured. Generally the
>logical session is terminated by the container, eventually the
connection >pool will terminate the physical session if some idle
timeout value is >reached, or if the physical session has been
determined to be stale.

I need the logical session to terminate physically as part of the
connection pooling recycling.

My admin program contains several applications.  During one user session
I may run several applications.  My suspicion is that when I exit one
and start another - the first database session is physically still
active while the second application has started.  This is the problem I
wrote to Heikki Tuuri about when it was evident that the
FOREIGN_KEY_CHECKS was still set to 0.

My question regarding your response:
>JBoss is most likely using a connection pool, which means that the
>connection doesn't physically close, which also means that the value
for >SET FOREIGN KEY CHECKS isn't reset to its default value
automatically.

>If you can use MysqlConnectionPoolDataSource with JBoss' connection
pool, >the MySQL JDBC driver will reset connection state when the
"logical" >connection is closed. If you don't use our
ConnectionPoolDataSource, your >application is responsible for setting
session-level variables that affect >server behavior to appropriate
values before returning them to the >connection pool.

How do I use the MysqlConnectionPoolDataSource with JBoss' connection
pool???  How do I make sure that every EJB is associated with one
database session only?  In other words how do I use your
ConnectionPoolDataSource to ensure that the MySQL JDBC driver will reset
connection state when the "logical" connection is closed?

Thank you much in advance -

Noga


-----Original Message-----
From: Mark Matthews [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 20, 2005 9:35 AM
To: Noga Woronoff
Cc: mysql@lists.mysql.com
Subject: Re: Regarding MysqlConnectionPoolDataSource

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Noga Woronoff wrote:
> Hi Mark -
> 
> 1.  Can you deploy the MysqlConnectionPoolDataSource with JBoss 3.2.5
> using J/Connector 3.0.15 (using MySQL 4.0.21)?

Noga,

Sure, but it's not required, and generally the JBoss folks seem to
prefer using driver-based dispensers for connections with their
connection pool implementation since they already have classes that map
SQLExceptions to errors that can determine whether or not a connection
is stale (which is basically one of the major features of a
ConnectionPoolDataSource).

Remember, ConnectionPoolDataSources are _not_ connection pools. They
provide connections to some implementation of a connection pool.

> 
> 2.  If so - is the documentation "1.4.3. Using Connector/J with JBoss"
> for the mysql-ds.xml enough using the <driver-class> tag or do you
have
> to add a tag that provides an explicit reference to the
> MysqlConnectionPoolDataSource method?

See my answer to #1.

>    
> 3.  Am I correct to assume that once you made the correct reference in
> mysql-ds.xml to using MysqlConnectionPoolDataSource - JBoss takes it
> from there and manages the connection pooling with every
getConnection()
> and free() method calls?  That is - you never have to import and/or
make
> references to the MysqlConnectionPoolDataSource method in your EJB? 

You should never refer to concrete implementations of any of the JDBC
APIs in your container-managed code such as EJBs. You always code to the
interface, i.e. javax.sql.DataSource. Otherwise your code won't be
portable to other JDBC implementations.

> 4.  Last, when using the MysqlConnectionPoolDataSource method - does
the
> application server automatically terminates the EJB database session
as
> part of the connection pool recycling?

Depends on the connection pool and how it's configured. Generally the
logical session is terminated by the container, eventually the
connection pool will terminate the physical session if some idle timeout
value is reached, or if the physical session has been determined to be
stale.
        
        -Mark


- --
Mark Matthews
MySQL AB, Software Development Manager - Connectivity
www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDqBaQtvXNTca6JD8RAui6AKCl2RNquhnfvao9jfaGVQ0nnq7kNACeP9RP
oa+feaD00tvBWLneNf3yAaE=
=VGGx
-----END PGP SIGNATURE-----

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to