java - How can I execute a stored procedure with JDBC / jTDS without using a transaction? -


we run website written in java uses jdbc jtds access sql server database.

our database contains complex stored procedure typically takes 10 minutes run. stored procedure works fine if execute directly (say sql server management studio) because not run in transaction. if execute using jtds locks entire website 10 minutes. happens because jtds runs in transaction, , website requests on hold waiting transaction finish.

for example, following locks website due transaction:

connection connection = drivermanager.getconnection("jdbc:jtds:sqlserver://example/example"); callablestatement callablestatement = connection.preparecall("exec dbo.proctest"); callablestatement.execute(); 

is there way can run stored procedure using jdbc / jtds without running in transaction?

please note calling on jtds connection not valid:

connection.settransactionisolation(connection.transaction_none); 

that throws exception stating connection.transaction_none parameter not supported jtds.


edit: have asked question better: core problem not transaction itself, problem transaction causes database locks held 10 minutes. either need get rid of transaction, or need locks released during transaction.

calling connection#close() or connection#commit() should submit , end transaction. close db resources connection in finally block?


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -