Closed GoogleCodeExporter closed 9 years ago
There is a workaround better than commit.
Before each such @Select("INSERT ...")
you may perform @Update("SELECT 1") @Options(flushCase=true).
Sure, not so pretty, but at leat you can save your transaction logic.
Original comment by dmitry.m...@muranosoft.com
on 16 Oct 2011 at 1:34
[deleted comment]
[deleted comment]
I suppose this is failing because of local session cache. Use
SqlSession.clearCache() after each statement.
You may also try with Jdbc3 key generation.
Original comment by eduardo.macarron
on 6 Feb 2012 at 3:15
This issue is fixed in 3.0.6,
http://code.google.com/p/mybatis/issues/detail?id=404
@Options(useCache = false) should work for you.
You should probably check it.
Original comment by dmitry.m...@muranosoft.com
on 9 Feb 2012 at 5:57
Even mybatis3.1.1 has the bug.
Select query is getting cached. There is no way to disable cache of select
query. Below is a test case,
1. open a mybatis session.
2. execute a select query.
3. Leave the connection open in some static variable.
4. delete all the records from table on which above select query is executed.
5. execute the same select query on above open mybatis session. It will show
the same result, whereas actually all data from the table is deleted.
useCache in select tag does not work in this case also in code I've tried to
clear cache using SqlSession.clearCache(). But even then I get same old value.
Please suggest what to do?
Original comment by shan2005...@gmail.com
on 4 Jun 2012 at 8:00
Original issue reported on code.google.com by
mweid...@gmail.com
on 3 Oct 2011 at 7:49