DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCCORE-1204
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Kaarel Kann
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Core

Object is left in 2nd level cache when commit() fails

Created: 13/May/14 10:10 AM   Updated: 30/May/14 09:29 AM   Resolved: 29/May/14 05:32 PM
Component/s: Transactions
Affects Version/s: 4.0.0.m2
Fix Version/s: 4.0.0.release

File Attachments: 1. Zip Archive commit-fail-test.zip (8 kB)
2. Java Source File SimpleTest.java (3 kB)

Environment: any

Severity: Test/Acceptance


 Description  « Hide
When exception is thrown during commit (but after flush) then object is left in 2nd level cache making application state inconsistent with database.

Sort Order: Ascending order - Click to sort in descending order
Kaarel Kann added a comment - 13/May/14 10:11 AM
attached test files

Andy Jefferson added a comment - 28/May/14 11:58 AM
Suggestion of the simplest way of fixing this : in the method that updates the L2 cache, create a Set of the ids of the objects that were updated, and then in postRollback evict all of these id's from the L2 cache.

Andy Jefferson added a comment - 29/May/14 05:32 PM
Patch is now in GitHub. Thx