3709 error in ADO when using persistant conenction

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I have created a VB.Net application that used classic ADO to access the
oracle database. I have mentained a persistant connection in it. When i start
the application and it works fine. All of a sudden i start receiving the
following error messages countineoully as my appllication polls the database
afetr some specified amount odf time.

"Error : No. :3709 :The requested operation requires an OLE DB Session
object, which is not supported by the current provider., Source
:ADODB.Command, Procedure :clsOrder.SetupADO_WFC_Update_Order"

"Error : No. :3709 :Te connection cannot be used to perform this operation.
It is either closed or invalid in this context., Source :ADODB.Command-- "

Here one thing I would like to point that I have never called Close method
on conenction object. That is called only when I am shutting down the app.

In this case I have to shut down my application in order to overcome this.
When I start the application again it starts working fine and then suddenly
same thing happens. I have searched a lot on net but this has become a
headache for me.

Could anyone help me out.
 
It sounds like your program is running out of ressources for connections.
To prevent this from happening the overall technique is not use persistent
connnections.

The sequence is Open a connection, Get a copy of the data you need and
import it locally to your machine. Close the connection tro free the
resources being used.
Do whatever needs to be done to your data, add edit, delete etc..
Open the connection, send the updates to the server, close the connection.

That's basically the way you can work with datasets in .Net.

What I found effective is to define a global string variable G_Connstr.

There is a key inn the app.config file that has the connection string.
Usually I just give it key name ConnectionString. In some apps I may need to
use ADO connections in some code parts, OLEDB connections in other parts,
and also ODBC connections. In such a case I have the appropriate number of
global variables like G_ConnstrODBC, G_ConnstrOLDEB, g_Connstr_ADO and the
correct number of Connectionstring keys in the app.config file.
When I start my app I retrieve the keys. Test to see if each one being used
can be used to connect succesfulley to the database. IF yes the app can
continue to load and the app.config key value is written to the apprpriate
G-Connstr for each type of data access, if a connection test fails, user is
advised of error in database connection and told to correct before using
app.
Any class that needs to open a connection now just has to
Dim MyConn as new WheteverTypeConnection.Connection
MyConn.Connectionstring = G_ConnstringXXX
MyConn.Open
'do whatever needs to be done
MyConn.close

If you are using bound controls you will always find a connection property
that needs to be set, Write code to set the connection properties of the
controls that need them in the form load event.

Like
mycontrol.connection = G_ConnstrXXX

Purists may say that use of global variables is not reccomended. I use it in
this case with good success in this case.

HTH
Bob
 
I strongly disagree

ADO.net should not be used for _ANYTHING_ because of the fact that it
doesn't support persistent connections.

in ADO classic WE HAD A CHOICE.
and Microsoft STOLE our langauge and tried jamming this Visual Fred
_CRAP_ up our ass--

I just refuse to accept 'you shouldn't use persistent connections'


Microsoft should NEVER give us a new version of _ANYTHING_ with LESS
FUNCTIONALITY
in ADO classic we could leave it open; or we could close it as we
please.

ADO.net has LESS FUNCTIONALITY

thus _SCREW_ .NET
 
Back
Top