Does Oracle PreparedStatement.executeUpdate() handle connection pool exhaution by throwing an instance of SQLException?
Will Oracle PreparedStatement.executeUpdate()
API throw an exception of type SQLException
if the connection pool is exhausted?
My application codes (KMDatabaseDAO.insert()
) is calling the Oracle PreparedStatement.executeUpdate()
API, however, the method seems to only throw an SQLException
, because existing production codes have pretty messed up the logging level, i am unable to recover the actual logs printing out.
Below is the thread dump taken.
"ExecuteThread: '79' for queue: 'weblogic.kernel.Default'" daemon prio=1 tid=0x1b459f28 nid=0x5c62 runnable [1842b000..1842c228]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at oracle.net.ns.Packet.receive(Unknown Source)
at oracle.net.ns.DataPacket.receive(Unknown Source)
at oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.net.ns.NetInputStream.read(Unknown Source)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:979)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:951)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:435)
at oracle.jdbc.dr开发者_运维问答iver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:182)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:630)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1081)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2905)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:2977)
- locked <0x3339ad48> (a oracle.jdbc.driver.T4CPreparedStatement)
- locked <0x2f8327d0> (a oracle.jdbc.driver.T4CConnection)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:147)
at com.sia.sd.db.dao.KMDatabaseDAO.insert(KMDatabaseDAO.java:125)
Oracle PreparedStatement API
The fact that you have a PreparedStatement means that you've already retrieved a connection from the pool, so no, the pool is not exhausted, and executing a PreparedStatement can't exhaust it because doing so doesn't retrieve another Connection from the pool.
精彩评论