Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Duplicate
-
None
-
None
-
None
Description
Since the close method on the Transactional interface means "abort if commit hasn't been called", mixing Transactional and AutoCloseable interfaces where close means "we're done here" is pretty much never the right thing to do.
The only class that does this is SequentialWriter. It's not used in a way that causes a problem, but it's still a potential hazard for future development.
The attached patch replaces the SequentialWriter OutputStream implementation with a wrapper class that implements the expected behavior on close, and adds a warning to the Transactional interface. It also adds a unit test that demonstrates the problem without the fix.
Attachments
Attachments
Issue Links
- is depended upon by
-
CASSANDRA-10083 Revert AutoSavingCache.IStreamFactory to return OutputStream
- Resolved