mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
support XA
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package com.alibaba.druid.pool.xa;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.sql.XAConnection;
|
||||
import javax.sql.XADataSource;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
|
||||
|
||||
public class DruidAXDataSource extends DruidDataSource implements XADataSource {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Override
|
||||
public XAConnection getXAConnection() throws SQLException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public XAConnection getXAConnection(String user, String password) throws SQLException {
|
||||
throw new UnsupportedOperationException("Not supported by DruidDataSource");
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -14,9 +14,9 @@ import com.alibaba.druid.pool.DruidPooledConnection;
|
||||
import com.alibaba.druid.support.logging.Log;
|
||||
import com.alibaba.druid.support.logging.LogFactory;
|
||||
|
||||
public class XAPoolableConnection extends DruidPooledConnection implements XAResource {
|
||||
public class DruidXAPoolableConnection extends DruidPooledConnection implements XAResource {
|
||||
|
||||
private final static Log LOG = LogFactory.getLog(XAPoolableConnection.class);
|
||||
private final static Log LOG = LogFactory.getLog(DruidXAPoolableConnection.class);
|
||||
|
||||
protected final XAConnection xaConnection;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class XAPoolableConnection extends DruidPooledConnection implements XARes
|
||||
|
||||
private Lock stateLock = new ReentrantLock();
|
||||
|
||||
public XAPoolableConnection(DruidConnectionHolder holder, XAConnection xaConnection) throws SQLException{
|
||||
public DruidXAPoolableConnection(DruidConnectionHolder holder, XAConnection xaConnection) throws SQLException{
|
||||
super(holder);
|
||||
|
||||
this.xaConnection = xaConnection;
|
||||
Reference in New Issue
Block a user