Skip to content

Commit 5a49a89

Browse files
committed
Make Interceptors pasivation capable
1 parent d417992 commit 5a49a89

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/main/java/org/mybatis/cdi/JtaTransactionInterceptor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
public class JtaTransactionInterceptor extends LocalTransactionInterceptor {
3232

3333
@Inject
34-
private UserTransaction userTransaction;
34+
private transient UserTransaction userTransaction;
3535

3636
@Override
3737
protected boolean isTransactionActive() throws Exception {

src/main/java/org/mybatis/cdi/LocalTransactionInterceptor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.mybatis.cdi;
1717

18+
import java.io.Serializable;
1819
import java.lang.reflect.InvocationTargetException;
1920
import java.lang.reflect.UndeclaredThrowableException;
2021

@@ -38,10 +39,10 @@
3839
*/
3940
@Transactional
4041
@Interceptor
41-
public class LocalTransactionInterceptor {
42+
public class LocalTransactionInterceptor implements Serializable {
4243

4344
@Inject
44-
private SqlSessionManagerRegistry registry;
45+
private transient SqlSessionManagerRegistry registry;
4546

4647
@AroundInvoke
4748
public Object invoke(InvocationContext ctx) throws Exception {

0 commit comments

Comments
 (0)