Hi All,
I am facing a problem and i am running out of ideas. It would be a great
if
any one of you can help me in resolving this. Please share your
experiences
if you had come across such a problem or heard about it.
I am using MDAC 2.6 .
The problem:
I have two connection objects say conn1 ,conn2.
Now in my situation conn1 starts first executing conn1.execute and just
after some 30 seconds RecordSetuses conn2 to fire a query on DB and fetch
the
records.
Can you forsee any problem in this case. Conn1 executes a select clause
and
creats a table table in say schema SCH1 and conn2 executes a select clause
to
fetch records from a table which sits in say schema SCH2.
Can you forsee anyproblem in this situation
The code is hanging at a call to RecordSet.open() and control return's
back
after 30-40 minutes. I am reusing the connection object and this is not
ASP ,
it is VJ++. Please dont give up that you dont know VJ++ . I feel this
problem
dosent need VJ++ knowledge , it need knowledge about ADO and MDAC calls.
Coming back to problem , i have enabled SQL profiler and found that the
SQL
is fired at DB only in the last minute of the hanging period.
I am using the following code to open a connection:
conn = new Connection();
conn.setCommandTimeout(m_commandTimeout);
conn.setCursorLocation(msado15.CursorLocationEnum.adUseClient);
conn.Open(sConnStr, "", "", ConnectOptionEnum.adConnectUnspecified);
Record Set code:
IWTTabular is a wrapper around RecordSet().
IWTTabular tabRet = new WTTabular();
tabRet.setCacheSize(100);
tabRet.Open(new Variant(sSQL), new Variant(conn),
CursorTypeEnum.adOpenForwardOnly, LockTypeEnum.adLockBatchOptimistic, CommandTypeEnum.adCmdText);
I have tried changing adLockBatchOptimistic , but the code is hanging at
..open and sometimes at setCacheSize(). The memory usage , CPU usage is
normal
and number of connections are also normal. I strongly feel there is some
serious problem with connection object or RecordSet.
Any thoughts on this problem please share them .
Any help will be highly appreciated.


|