Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
[deleted comment]
[deleted comment]
This problem may also happen when changing executor type.
If this two sentences are executed in the same transaction:
sqlSessionTemplate.execute(oneCallback, ExecutorType.SIMPLE);
sqlSessionTemplate.execute(oneCallback, ExecutorType.BATCH);
The second one will always be executed with the first executor type
because it will reuse the SqlSession.
Original comment by eduardo.macarron
on 24 Oct 2010 at 11:35
Fixed the ExecutorType issue. SqlSessionUtils now throws an exception if you
try and change in the middle of a transaction.
For the original issue, we want to force users to use a second
SqlSessionFactory for a second DataSource, correct? If that's the case, the
easiest thing would be to override setDataSource() in SqlSessionTemplate and
just throw OperationNotSupportedException. (Rather than copy/paste the
JdbcAccessor code that deals with the ExceptionTranslator).
Original comment by hpresnall@gmail.com
on 24 Oct 2010 at 8:13
fixed with:
- sqlSessionTemplate uses SqlSession ds not its parent's
- removed constructor with ds
- IllegalArgumentException if ds is attempted to be changed
- removed SqlSessionSupport datasource property
- removed MapperFactoryBean datasource property
- fixed tests
Original comment by eduardo.macarron
on 24 Oct 2010 at 9:18
Attachments:
Original comment by eduardo.macarron
on 1 Jan 2011 at 4:40
Original issue reported on code.google.com by
eduardo.macarron
on 23 Oct 2010 at 8:41Attachments: