Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Cannot Reproduce
-
3.0 Beta 8, 3.0 Beta 9
-
None
-
None
-
windows, ibatis-3-core-3.0.0.227.jar
Description
I am getting a exception while fetching data after insert, in the same transaction.
The steps to reproduce:
1. Fetch data using select statement. (The data is stored in local cache)
2. Insert some data using insert statement. (Local cache is cleared)
3. Inside the same transaction fetch data using the same select statement (and with the same params) as in step 1. (NullPointerException is thrown)
From what I can see, fetching data in step 3. executes loading of all deferredLoads (in BaseExecutor class). The load() method of DefferedLoad is always trying to load data from local cache, but the local cache is empty because of insert performed in step 2, so NullPointerException is thrown.
errorlog:
-
-
- Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed.
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:61)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:53)
at com.cloudsuite.ams.server.dao.module.DocumentCustomDAOImpl.fetchDocumentLineDistribution(DocumentCustomDAOImpl.java:35)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
- Cause: org.apache.ibatis.executor.ExecutorException: Executor was closed.
-
...
Exception in thread "main" java.lang.NullPointerException
....
Attachments
Issue Links
- is a clone of
-
IBATIS-687 Exception while fetching data after insert, in the same transaction
- Closed