views:

26

answers:

2

From some googling, it appears that .NET supports asynchronous operations with SQL Server 2005+. Does the latest JDBC driver support this? I can't find a mention of it anywhere, so I'm thinking it probably doesn't. But I figured it couldn't hurt to ask.

Thanks! Avi

+3  A: 

No, but that doesn't mean you can't do asynch database operations. You'd just put the asynch character in an appropriate layer, like a message driven bean or a Process thread. I don't see why JDBC should have to support a middle tier notion like asynch processing.

duffymo
+2  A: 

JDBC is pretty much all single threaded. From Connection down it is expected only one thread will use it for it's lifetime (ok Connections can get pooled but that should be invisible to the application and only one thread should be using a Connection at a time).

There is one exception which is Statement.cancel() which permits another thread to interrupt/cancel an in-progress query but I believe this is the only instance of multi-threaded-ness.

Like duffymo says typically if you want async behaviour you would build something on top of JDBC (and I would guess that's what .NET is doing under the covers).

Mike Q