mirror of
https://github.com/actiontech/dble.git
synced 2026-05-08 07:21:00 -05:00
#289 fix the error handling when xa transaction error in prepare
This commit is contained in:
+4
-4
@@ -22,21 +22,21 @@ public class NewConnectionRespHandler implements ResponseHandler {
|
||||
private ReentrantLock lock = new ReentrantLock();
|
||||
private Condition initiated = lock.newCondition();
|
||||
|
||||
public BackendConnection getBackConn() throws IOException{
|
||||
public BackendConnection getBackConn() throws IOException {
|
||||
lock.lock();
|
||||
try {
|
||||
if (backConn == null) {
|
||||
initiated.await();
|
||||
}
|
||||
if(backConn == null){
|
||||
if (backConn == null) {
|
||||
throw new IOException("get backend connection error ");
|
||||
}
|
||||
return backConn;
|
||||
} catch (InterruptedException e) {
|
||||
LOGGER.warn("getBackConn " + e);
|
||||
return null;
|
||||
} catch(IOException e){
|
||||
throw e;
|
||||
} catch (IOException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user