yaseenkadir / etchedjournal

An encrypted journal where entries are etched in stone.
Apache License 2.0
0 stars 0 forks source link

Backend db operations are not transactionally safe #158

Closed yaseenkadir closed 5 years ago

yaseenkadir commented 5 years ago

We're not using transactions during DB operations. We should do so to prevent race conditions. I think we can get away with using @Transactional annotations on the service methods but perhaps we should just handle it ourselves.

yaseenkadir commented 5 years ago

I don't want to use the spring magic to handle transactions. It definitely works and I tested that it works but it's not easy to test. It doesn't seem to be too hard. We'll need to manually commit and close our transactions but I'd rather us have control over it.

yaseenkadir commented 5 years ago

You know what, testing that transactions are safely working is not a high priority issue. Going to just add @Transactional annotations to the services for now and leave it at that. We can worry about testing transactional integrity much later in the future. Lets do the most important things first.

yaseenkadir commented 5 years ago

I've flip flopped so much on this. Started working on both ways but was unhappy with how they were turning out. Decided to just roll my own. It's quite simple and naive but it works and is easy to verify.