Re: This one is for you ...

Re: This one is for you ...

am 28.02.2003 15:52:23 von Mark Matthews

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

Sinisa Milivojevic wrote:
>
> ------------------------------------------------------------ ------------
>
> Subject:
> Found HUGE Bug in MySQLPooledConnection
> From:
> "DM"
> Date:
> Thu, 27 Feb 2003 15:34:55 -0500
> To:
>
>
>
> I have found a HUGE bug in your code to MysqlPooledConnection, but it is
> easily fixed.
>
> How-To-Repeat:
>
> Take a look at the code for the close() method:
>
> public synchronized void close() throws SQLException {
> physicalConn.close();
> physicalConn = null;
> callListener(2, null);
> }
>
> You'll notice it sends the number 2 to the method callListener(). However, 2
> means an error occurred, 1 means close! Take a look at callListener():
>
> protected synchronized void callListener(int i, SQLException sqlException) {
> if(eventListeners == null) {
> return;
> }
> Enumeration enumeration = eventListeners.keys();
> ConnectionEvent connectionevent = new ConnectionEvent(this,
> sqlException);
> while(enumeration.hasMoreElements()) {
> ConnectionEventListener connectioneventlistener =
> (ConnectionEventListener)enumeration.nextElement();
> ConnectionEventListener connectioneventlistener1 =
> (ConnectionEventListener)eventListeners.get(connectioneventl istener);
> if(i == 1) {
> connectioneventlistener1.connectionClosed(connectionevent);
> } else if(i == 2) {
>
> connectioneventlistener1.connectionErrorOccurred(connectione vent);
> }
> }
> }
>
> Every time someone tries to close the physical connection, it instead throws
> an exception. This was in fact in your release code and when I fixed it and
> added the new class to the jar file the exceptions on close() disappeared.
> What do I need to do to add this fix to your release code?
>
> I hope this helps.
>
> David Musicant


Thanks. This is now fixed in what will be MySQL Connector/J 3.0.7 and
3.1.1. I use constants now for those values, so it is more apparent what
is being sent to the method in question.

-Mark


- --
MySQL 2003 Users Conference -> http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mark Matthews
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
/_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
<___/ www.mysql.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+X3eutvXNTca6JD8RAkyeAKDGh/5TCUTAKzZddaTHyuVPHaK+0wCe OyYt
3IT3/JkiOq02rOy+XSh0cFs=
=+Eu5
-----END PGP SIGNATURE-----


------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread13860@lists.mysql.com
To unsubscribe, e-mail