loadbalance url : statement vs preparedstatement
Posted by: murat cengiz
Date: December 25, 2012 03:23AM
Is there a difference between using regular statements vs using prepared statements in regards to rebalancing behaviour of connector/j?
I execute the following:
1. get connection from driver
2. make the first host (host1) unavailable
3. execute some sql on the connection (should fail). sql="select field1 from nonexistingtable"
connector/j : 5.1.18
If i execute the 3rd step using regular statements, a physical connection to host2 is established. (query fails after sockettimeout ms)
But if i execute the same step using a prepared statement, no physical connections are established to host2. (query fails after sockettimeout ms)
Is there a reason why they behave differently? Is this expected behaviour?
Actually i am trying to validate the connection, and i read somewhere that the validation query should start with "/* ping */", especially for a loadbalanced configuration. Does anyone know what this "ping" query actually does?
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.