Search code examples
sesame

Unclear semantics of sesame 2.7 begin()


Is it defined what should happen if begin() is called when there is already an active transaction? As I see it, there are four possibilities:

A. an exception is thrown

B. the begin() is silently ignored

C. some kind of transaction nesting takes place

D. it's undefined


Solution

  • The answer is A, an exception is thrown. A Sesame RepositoryConnection only supports one active transaction at the same time - if concurrent transactions are needed, you need to work with multiple connections (a corrolary to this is that it's a bad idea to share a RepositoryConnection across threads).

    I'll make sure the API Javadoc is updated to make this more clear.