开发者

Asynchronous database operations with Oracle database using C#, .NET?

I need to connect and perform some operation on oracle database from my C#/.NET application. Since it is a high load serv开发者_如何学运维er application, I wish that I use only async calls to do database operations.

I understand that System.Data.OracleClient is obsolete now, what are my options to do achieve above?


I haven't looked into this for a couple of years now but it wasn't possible when I looked. Async. operations are only supported by the SQL Server client.

Your only option is to create your own asynchronous methods. This is well documented so I won't go over it again here.


You can create job in sqlserver then schedule it to execute immediately. That all can be done in a single query. Oracle have also similar concept.


You could use DBMS_JOB or the more modern DBMS_SCHEDULER to have Oracle run something and then return. There's a configurable limit to how many jobs Oracle with run concurrently, make sure it's high enough for your app.

You could also use Oracle AQ. Setup a Queue, have 1..n job(s) that's watching the queue for something to do.


You don't need to change any programming approach, you just need to get your DLL from a different source. Microsoft is essentially saying (if I understand the article) that their version of System.Data.OracleClient is depreciated, but the version Oracle provides is the one to use.

It's a little confusing, I had this problem when I first worked on an Oracle DB from .NET code, but both Oracle and Microsoft have libraries that are called "System.Data.OracleClient".

So get the Oracle one and use the exact same code for your asynch calls that you would have used with Microsoft's.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜