Hi,
I would like to know how transactions are handle over an RDFConnection
to a local dataset.
When using directly the dataset, you pointed that it doesn't matter if
you user a static instance or not for storing the dataset, as Txn
internally manages and handle everything. In this sense you recommended
using a static instance. Is it the same for RDFConnection or are
transactions linked to the instance?
The issue here is if 1) and 2) behaves similarly when multitheaded calls
to Txn are done. Are both methods blocking access to the dataset? Or is
case 1) only blocking on the instance of the connection and multiple
simultaneous call will led to error?
Thanks for your help
Jorge
1) Per call connection
try ( RDFConnection conn = RDFConnectionFactory.connect(...) ) {
Txn.execWrite(conn, ()-> {
// Whatever
}) ;
}
2) Static instance
public static RDFConnection conn = RDFConnectionFactory.connect(...);
// ....
// In a method
Txn.execWrite(conn, ()-> {
// Whatever
}) ;