strolch/li.strolch.service
Robert von Burg 46ccb921df [Major] Refactored how a TX is closed
- So sadly just auto closing a TX using try-resource from Java7 is a bad idea.
- Doing that leads to problems when an exception is thrown, then the close is called (duh) but this leads to commit being called.
- Since the Java language does not offer a decent way to detect if the close is being called in the context of an exception i was forced to add a tx.commitOnClose() and tx.rollbackOnClose().
- The default is that when a TX is opened, then the close strategy is rollback; the API user must call tx.commitOnClose() before the TX is closed by the braces, or as late as possible, to make sure that if an exception is thrown the transaction is rolled back, and not committed.
- The API was also extended with a tx.fail(msg):StrolchTransactionException so that if the implementor detects an unrecoverable error, one can write: throw tx.fail(“my reason”);

This was sadly an unavoidable late 1.0.0 change
Conflicts:
	li.strolch.agent/src/main/java/li/strolch/persistence/api/AbstractTransaction.java
2015-02-03 23:21:28 +01:00
..
src [Major] Refactored how a TX is closed 2015-02-03 23:21:28 +01:00
.gitignore moved everything to a subdirectory for repo merge 2014-09-16 08:53:28 +02:00
LICENSE moved everything to a subdirectory for repo merge 2014-09-16 08:53:28 +02:00
README.md moved everything to a subdirectory for repo merge 2014-09-16 08:53:28 +02:00
pom.xml [Project] Bumped version from 1.0.0-RC1 to 1.0.0-SNAPSHOT 2014-09-20 15:23:11 +02:00

README.md

li.strolch.service

Build Status

Service API for Strolch

Running tests

  • Install PostgreSQL and create the following users: create user cacheduser with password 'test'; create database cacheduserdb; GRANT ALL PRIVILEGES ON DATABASE cacheduserdb to cacheduser; GRANT CONNECT ON DATABASE cacheduserdb TO cacheduser;

create user transactionaluser with password 'test'; create database transactionaluserdb; GRANT ALL PRIVILEGES ON DATABASE transactionaluserdb to transactionaluser; GRANT CONNECT ON DATABASE transactionaluserdb TO transactionaluser;

You can revoke the privileges with the following:

revoke ALL PRIVILEGES ON DATABASE cacheduserdb from cacheduser; drop user cacheduser; drop database cacheduserdb;

revoke ALL PRIVILEGES ON DATABASE transactionaluserdb from transactionaluser; drop user transactionaluser; drop database transactionaluserdb;