Unexpected Nested Transactions

0 views
Skip to first unread message

Paul Gearon

unread,
Mar 24, 2014, 2:41:46 AM3/24/14
to sta...@clarkparsia.com
Hi,

While trying to write some test code I executed an update operation that inserted data, and appeared to work well. (Querying for the data showed that it was there). I subsequently removed it, so I could try the operation again.

Unfortunately, whenever I attempt to call execute on the UpdateQuery object, I am getting a OperatorException telling me: "Cannot open nested transactions". I don't have nested transactions, so I don't know what's going on.

The equivalent code here is:

  ConnectionConfiguration config = ConnectionConfiguration.to("nr");
  config.server("snarl://localhost");
  Connection c = config.connect();
  c.begin();
  UpdateQuery u = c.update("prefix math: <http://ex.com/math#> prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> insert data {math:42 rdfs:comment 'This number was popularized by Douglas Adams'}");
  u.execute();

Wondering if I'd left things in some bad state, I closed my process, and restarted the Stardog server, but this changed nothing.

Have I done something that's obviously wrong please?

Thanks in advance.

Paul Gearon

Mike Grove

unread,
Mar 24, 2014, 6:40:50 AM3/24/14
to stardog
Yep, you don't need the begin call on the connection; update queries are executed within their own transaction, which is why you get the message about nested transactions.  You created one manually on the connection and the query is trying to create another.

Cheers,

Mike
 

Thanks in advance.

Paul Gearon

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages