java - Apache Jena SDB Transactions support -
i using apache jena api on sql database(micrtosoft sql server) known jena sdb have problem when want acces database in trensactional manner. when use jena tdb transactions supported when use jena tdb in stransactinal manner java.lang.unsupportedoperationexception: transactions not supported exception thrown.
snippet jena tdb working follows:
dataset dataset = return tdbfactory.createdataset("datasetlocation"); dataset.begin(readwrite.write); //...
snippet jena sdb not working follows:
storedesc storedesc = new storedesc(layouttype.layouttriplenodeshash, databasetype.sqlserver); sdbconnection sdbconn = new sdbconnection(getconnection()); store store = storefactory.create(storedesc, sdbconn); dataset dataset =datasetstore.create(store); dataset.begin(readwrite.write); //...this throws exception
my question since requirement migrate tdb sdb(i know not recomended) there way use jena sdb in transactional manner
it's transactional - default, autocommit can expensive.
you can manipulate jdbc connection setting directly, or use model's transactionhandler
because models same dataset map same code act on jdbc connection, available as:
store.getconnection().gettransactionhandler()
Comments
Post a Comment