HighTechTalks DotNet Forums  

RE: Repost of ODBC Transaction Problem

Dotnet Framework (ADO.net) microsoft.public.dotnet.framework.adonet


Discuss RE: Repost of ODBC Transaction Problem in the Dotnet Framework (ADO.net) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-05-2004 , 07:31 AM






Hi,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that your are starting an ODBC Transaction
to update your data source. However, the trasaction cannot be begun if the
DataAdapter doesn't have an update command. If there is any
misunderstanding, please feel free to let me know.

This issue seems to be unususal, because the start of the transaction has
nothing to do with the update command before it is called. Please try to
use a different isolation level with the following code to see if it works.

ODBCTRANSACTION =
Me.OdbcConnection1.BeginTransaction(IsolationLevel .ReadCommitted)

If the problem still persists, could you please let me know the data source
you are updating?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #2  
Old   
Robert Pfeffer
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-08-2004 , 05:56 PM






Hi Kevin

There are 2 dataadapters. I does have an update statement. The other does not. The transaction is associated with the connection, not with the dataadapters

I did as you suggested and changed the transaction type to readcommitted. It had the same problem

Bob Pfeffer

Reply With Quote
  #3  
Old   
Robert Pfeffer
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-08-2004 , 06:01 PM



Hi Kevin,

The data source is an IBM DB2 Database. The connection string is:
"DSN=A0216001;UID=SASLMF;DBALIAS=A0216001;PWD=xxxx xxxxx"

The odbc source is a System Data Source using IBM DB2 ODBC DRIVER.

Bob

Reply With Quote
  #4  
Old   
AT
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-09-2004 , 05:12 AM



Hi Bob,

Would you please try to simplify the code to reproduce the problem? You can
try with only 2 line of codes as follows to narrow down the problem:

Dim OdbcConnection1 as New
OdbcConnection("DSN=A0216001;UID=SASLMF;DBALIAS=A0 216001;PWD=xxxxxxxxx")
ODBCTRANSACTION =
Me.OdbcConnection1.BeginTransaction(IsolationLevel .RepeatableRead)

If the problem still persists, would you please try to do an ODBC trace to
see where the exception was thrown exactly?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #5  
Old   
Robert Pfeffer
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-11-2004 , 05:41 AM



Hi Kevin

Here is a stack trace whe the error occurs. Is this what you wanted

Bo

system.data.dll!System.Data.Odbc.OdbcConnection.Ha ndleError(System.Runtime.InteropServices.HandleRef hrHandle = {System.Runtime.InteropServices.HandleRef}, System.Data.Odbc.ODBC32.SQL_HANDLE hType = DBC, System.Data.Odbc.ODBC32.RETCODE retcode = ERROR) + 0x35 bytes
system.data.dll!System.Data.Odbc.OdbcConnection.Be ginTransactionObject(System.Data.IsolationLevel isolevel = ReadCommitted) + 0x1a4 bytes
system.data.dll!System.Data.Odbc.OdbcConnection.Be ginTransaction(System.Data.IsolationLevel isolevel = ReadCommitted) + 0x2f bytes
Quote:
TRYIT.exe!TRYIT.Form1.Form1_Load(Object sender = {TRYIT.Form1}, System.EventArgs e = {System.EventArgs}) Line 128 + 0x25 bytes Basi
system.windows.forms.dll!System.Windows.Forms.Form .OnLoad(System.EventArgs e = {System.EventArgs}) + 0x168 bytes
system.windows.forms.dll!System.Windows.Forms.Form .OnCreateControl() + 0x43 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl(bool fIgnoreVisible = false) + 0x211 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.CreateControl() + 0xe bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.WmShowWindow(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xeb bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x6cb bytes
system.windows.forms.dll!System.Windows.Forms.Scro llableControl.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x6c bytes
system.windows.forms.dll!System.Windows.Forms.Cont ainerControl.WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x37 bytes
system.windows.forms.dll!System.Windows.Forms.Form .WmShowWindow(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x37 bytes
system.windows.forms.dll!System.Windows.Forms.Form .WndProc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x214 bytes
system.windows.forms.dll!ControlNativeWindow.OnMes sage(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0x13 bytes
system.windows.forms.dll!ControlNativeWindow.WndPr oc(System.Windows.Forms.Message m = {System.Windows.Forms.Message}) + 0xda bytes
system.windows.forms.dll!System.Windows.Forms.Nati veWindow.DebuggableCallback(int hWnd = 1377046, int msg = 24, int wparam = 1, int lparam = 0) + 0x3d bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.SetVisibleCore(bool value = true) + 0x139 bytes
system.windows.forms.dll!System.Windows.Forms.Form .SetVisibleCore(bool value = true) + 0xf7 bytes
system.windows.forms.dll!System.Windows.Forms.Cont rol.set_Visible(bool value = true) + 0x18 bytes
system.windows.forms.dll!ThreadContext.RunMessageL oopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x162 bytes
system.windows.forms.dll!ThreadContext.RunMessageL oop(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x50 bytes
system.windows.forms.dll!System.Windows.Forms.Appl ication.Run(System.Windows.Forms.Form mainForm = {TRYIT.Form1}) + 0x34 bytes
TRYIT.exe!TRYIT.Form1.Main() Line 1 + 0x1d bytes Basi



Reply With Quote
  #6  
Old   
AT
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-13-2004 , 08:01 AM



Hi Bob,

The trace I mentioned in my last post is an ODBC trace. Here are the steps
to start an ODBC trace.
1. Start -> Control Panel -> Administrative Tools -> Data Sources (ODBC)
2. Set the log file path.
3. Click Start Trace Now button to start trace.

Please try to use the following lines of code to reproduce the problem
first. If the problem can be reproduced with the code, you can try to do
the trace with the steps above and paste the trace log from the log file
here. Thanks for your cooperation.

Dim OdbcConnection1 as New
OdbcConnection("DSN=A0216001;UID=SASLMF;DBALIAS=A0 216001;PWD=xxxxxxxxx")
ODBCTRANSACTION =
Me.OdbcConnection1.BeginTransaction(IsolationLevel .RepeatableRead)

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #7  
Old   
Robert Pfeffer
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-16-2004 , 09:46 AM



Hi Kevin

The setting of the transaction after the open of the connection works

It is setting a transaction after doing a fillschema and before a fill that causes the proble

The trace is too big to include in this post. Is there another way I can send you the trace file

Thanks

Robert

Reply With Quote
  #8  
Old   
AT
 
Posts: n/a

Default RE: Repost of ODBC Transaction Problem - 04-17-2004 , 02:10 AM



Hi Robert,

It seems that you have had the problem resolved. If it persists, please
feel free to send the trace by mail. Remove 'online' from the no spam email
is my real email address. I'd be happy if I can help.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
  #9  
Old   
Angel Saenz-Badillos[MS]
 
Posts: n/a

Default Re: Repost of ODBC Transaction Problem - 04-18-2004 , 08:53 PM



Robert,
I have just tried your repro against Sql Server and I was not able to repro
this exception and the stack trace you have posted seems to indicate that
the exception may be coming from the native provider to make things harder.

I have compiled the information from this thread and will try to track down
some more information.
I really appreciate the detailed description of the problem, let me know if
you can figure out how to post the odbc trace or at least the interesting
portions
Thank you,
--
Angel Saenz-Badillos [MS] Managed Providers
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.


"Robert Pfeffer" <rmp (AT) svs (DOT) com> wrote

Quote:
Hi Kevin,

The setting of the transaction after the open of the connection works.

It is setting a transaction after doing a fillschema and before a fill
that causes the problem

The trace is too big to include in this post. Is there another way I
can send you the trace file.

Thanks,

Robert



Reply With Quote
  #10  
Old   
AT
 
Posts: n/a

Default Re: Repost of ODBC Transaction Problem - 04-29-2004 , 03:28 AM



Hi Robert,

Thanks for your update! It is quite weird that the invoke of
begintransaction did not log any activity in the trace. So I think the
begintransaction might not delivered to the database. Could you try to put
the transaction before fillschema to see if it can resolved the problem?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.