Open GoogleCodeExporter opened 9 years ago
Issue 549 has been merged into this issue.
Original comment by eduardo.macarron
on 20 Mar 2012 at 4:53
Original comment by eduardo.macarron
on 20 Mar 2012 at 4:53
Looks really good!. I will discuss this change with the other devs to see what
they think.
Refreshed patch. Not all test pass but will have a deeper look if the change is
accepted.
Original comment by eduardo.macarron
on 20 Mar 2012 at 5:52
Attachments:
After a discussion we came out with this conclusion.
This fix introduces a bigger problem than it solves because there is a problem
with the order.
For example:
batch executor: insert data x
simple executor: select data x -> will fail because batch executor is not still
flushed
Using just one executor will work because select will flush pending statements
but when using more than one that is not possible.
So I am afraid this reason is enough not to fix that.
Thank you anyway for your hard work and the patch. We do really appreciate this
kind of contributions!
Original comment by eduardo.macarron
on 21 Mar 2012 at 5:39
updated patch
Original comment by eduardo.macarron
on 23 Mar 2012 at 6:44
Attachments:
Original comment by eduardo.macarron
on 12 Apr 2012 at 7:54
Hi you changed the status of this issue, do you plan to allow different
executor types inside a transaction ?
Original comment by brice.du...@gmail.com
on 17 Dec 2012 at 11:32
There was no agreement in the dev team so I just left the issue in its initial
status.
Original comment by eduardo.macarron
on 17 Dec 2012 at 1:17
OK, that's fair
So for the record for anyone that stumble across this exception, as an
alternative, you can configure your context or your mappers with the SQL
template that uses the BATCh executor.
Original comment by brice.du...@gmail.com
on 17 Dec 2012 at 1:25
Yes, that is the way right now.
It is also recommended for those who want the feature to star it. If there is
interest enough we may re-open the discussion.
Original comment by eduardo.macarron
on 17 Dec 2012 at 8:15
Eventually you could have different sessionFactory, one for reading data that
will use a simple executor, and another that will use a session template
configured in batch mode.
I believe this is a safe approach as the executors are bound to the transaction.
Original comment by brice.du...@gmail.com
on 17 Dec 2012 at 8:19
i had looked above. If i have two sessionFactorys, one is for simple and the
other is for batch. Than, it's yes or no that the initialize will be executed
twice !?
Original comment by yaoh...@gmail.com
on 30 Jan 2013 at 8:31
Sorry? What do you mean?
Original comment by eduardo.macarron
on 30 Jan 2013 at 8:52
The approach #11 gived for solving batch and simple in one transaction means
Instantiating sessionFactory two times, yes? That means parsing the sqlMap.xml
twice,isn't it?
Original comment by yaoh...@gmail.com
on 30 Jan 2013 at 9:26
@Yao yes, that is the case. But note the sessionFactories should be
specialized, one for reading and one for writing (in a batch mode).
Note however that you should definitely use this approach with care, as your
code should avoid writing using the regular session factory. One way to do that
would be to have dedicated mapper files for reading (queries) and writing
(insert/update/delete statements), and you'll configure your sessionFactory
accordingly.
Original comment by brice.du...@gmail.com
on 30 Jan 2013 at 9:39
Issue 772 has been merged into this issue.
Original comment by eduardo.macarron
on 8 Feb 2013 at 3:43
Original issue reported on code.google.com by
xingba...@gmail.com
on 20 Mar 2012 at 3:25Attachments: