new connection implicitly created when autoReconnect was disabled
Hi,
I am experiencing some strange behavior related to "autoReconnect" parameter.
Here are the steps for a simple test i have run:
1 - get a connection from driver (having autoReconnect=false in the url)
2 - execute an sql
3 - make the master (primary) server unavailable (i.e. unplug network cable)
4 - execute sql on the connection (SHOULD fail)
5 - execute sql on the same connection again (SHOULD fail)
* monitor tcp connections throughout the test. NO connections to slave host should be opened.
url: jdbc:mysql://dbmaster,dbslave:3306/TESTDB?autoReconnect=false&connectTimeout=5000&socketTimeout=30000&relaxAutoCommit=true&
failOverReadOnly=false&characterEncoding=UTF-8
connector/j : 5.1.18 (and 5.1.22 with same results)
java: 1.6(.0.37)
I assumed that connector/j would not automatically "reconnect" a connection when autoReconnect was disabled.
But it seems that a connection is created against the slave(dbslave) at step 5. (at which the connection had already received a communications exception)
any comments?
thanks
Subject
Written By
Posted
new connection implicitly created when autoReconnect was disabled
December 20, 2012 03:14PM
December 21, 2012 11:21AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.