Loading sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/adapter/AbstractConnectionAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public abstract class AbstractConnectionAdapter extends AbstractUnsupportedOpera @Override public final void setAutoCommit(final boolean autoCommit) { this.autoCommit = autoCommit; TransactionContextHolder.set(new TransactionContext(new LocalTransactionManager(), TransactionType.XA, LocalTransactionEvent.class)); TransactionContextHolder.set(new TransactionContext(new LocalTransactionManager(), TransactionType.LOCAL, LocalTransactionEvent.class)); recordMethodInvocation(Connection.class, "setAutoCommit", new Class[] {boolean.class}, new Object[] {autoCommit}); EventBusInstance.getInstance().post(buildTransactionEvent(TCLType.BEGIN)); } Loading sharding-transaction/src/main/java/io/shardingsphere/transaction/common/TransactionContext.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public final class TransactionContext { private TransactionManager transactionManager; private TransactionType transactionType = TransactionType.XA; private TransactionType transactionType = TransactionType.LOCAL; private Class<? extends TransactionEvent> transactionEventClazz = LocalTransactionEvent.class; Loading sharding-transaction/src/main/java/io/shardingsphere/transaction/common/TransactionContextFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,6 @@ public class TransactionContextFactory { * @return local transaction context */ public static TransactionContext newLocalTransactionContext() { return new TransactionContext(new LocalTransactionManager(), TransactionType.XA, LocalTransactionEvent.class); return new TransactionContext(new LocalTransactionManager(), TransactionType.LOCAL, LocalTransactionEvent.class); } } sharding-transaction/src/main/java/io/shardingsphere/transaction/common/event/TransactionEventFactory.java +3 −2 Original line number Diff line number Diff line Loading @@ -38,9 +38,10 @@ public final class TransactionEventFactory { */ public static TransactionEvent create(final TCLType tclType) { switch (TransactionContextHolder.get().getTransactionType()) { case LOCAL: return new LocalTransactionEvent(tclType); case XA: return TransactionContextHolder.get().getTransactionEventClazz().isAssignableFrom(XaTransactionEvent.class) ? new XaTransactionEvent(tclType, "") : new LocalTransactionEvent(tclType); return new XaTransactionEvent(tclType, ""); case BASE: default: return null; Loading Loading
sharding-jdbc/src/main/java/io/shardingsphere/core/jdbc/adapter/AbstractConnectionAdapter.java +1 −1 Original line number Diff line number Diff line Loading @@ -93,7 +93,7 @@ public abstract class AbstractConnectionAdapter extends AbstractUnsupportedOpera @Override public final void setAutoCommit(final boolean autoCommit) { this.autoCommit = autoCommit; TransactionContextHolder.set(new TransactionContext(new LocalTransactionManager(), TransactionType.XA, LocalTransactionEvent.class)); TransactionContextHolder.set(new TransactionContext(new LocalTransactionManager(), TransactionType.LOCAL, LocalTransactionEvent.class)); recordMethodInvocation(Connection.class, "setAutoCommit", new Class[] {boolean.class}, new Object[] {autoCommit}); EventBusInstance.getInstance().post(buildTransactionEvent(TCLType.BEGIN)); } Loading
sharding-transaction/src/main/java/io/shardingsphere/transaction/common/TransactionContext.java +1 −1 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ public final class TransactionContext { private TransactionManager transactionManager; private TransactionType transactionType = TransactionType.XA; private TransactionType transactionType = TransactionType.LOCAL; private Class<? extends TransactionEvent> transactionEventClazz = LocalTransactionEvent.class; Loading
sharding-transaction/src/main/java/io/shardingsphere/transaction/common/TransactionContextFactory.java +1 −1 Original line number Diff line number Diff line Loading @@ -49,6 +49,6 @@ public class TransactionContextFactory { * @return local transaction context */ public static TransactionContext newLocalTransactionContext() { return new TransactionContext(new LocalTransactionManager(), TransactionType.XA, LocalTransactionEvent.class); return new TransactionContext(new LocalTransactionManager(), TransactionType.LOCAL, LocalTransactionEvent.class); } }
sharding-transaction/src/main/java/io/shardingsphere/transaction/common/event/TransactionEventFactory.java +3 −2 Original line number Diff line number Diff line Loading @@ -38,9 +38,10 @@ public final class TransactionEventFactory { */ public static TransactionEvent create(final TCLType tclType) { switch (TransactionContextHolder.get().getTransactionType()) { case LOCAL: return new LocalTransactionEvent(tclType); case XA: return TransactionContextHolder.get().getTransactionEventClazz().isAssignableFrom(XaTransactionEvent.class) ? new XaTransactionEvent(tclType, "") : new LocalTransactionEvent(tclType); return new XaTransactionEvent(tclType, ""); case BASE: default: return null; Loading