Github user srowen commented on the issue:
https://github.com/apache/spark/pull/13925
No, an exception will now only roll back anything that happened since the
last commit. It is not the same. The whole reason it's 'blocking' is that you
are holding open a transaction, but, that's the point.
There's an interesting point here though; this code is willing to proceed
if the RDBMS does not support transactions at all, in which case it _will_
write partial results that can't be rolled back. Really I'd think that in this
case you want to call `executeBatch()` only once at the end. I wonder if that's
actually a bug (CC @rxin who wrote that bit?)
However, if that is acceptable, then perhaps a weaker JDBC transaction
isolation level is acceptable for the case where transactions are supported. If
you're willing to accept dirty reads with `TRANSACTION_READ_UNCOMMITTED`, then
I don't think (?) the table has to be locked, which may solve your problem. It
still means the writes would be rolled back in case of a failure, which is much
of the point here according to comments.
CC @CK50 for the transaction question. Also barely related but shouldn't it
just call `supportsTransactions()` at the beginning?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]