views:

322

answers:

4

I need to connect and perform some operation on oracle database from my C#/.NET application. Since it is a high load server 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?

+1  A: 

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.

LazyGenius
+1  A: 

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.

affan
+1  A: 

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.

Stephanie Page
+1  A: 

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.

Justin C
But the problem is that ODP.NET doesnt support async operations!
Hemant
@Hemant - I'm sorry, I assumed the Oracle version of the library would have the same features. Do you have experience with the ThreadPool? You could essentially develop your own async framework by having each thread you create start it's own connection. It's definitely a little more work, but it may be the only option.
Justin C