Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente bannato
    Registrato dal
    Jun 2004
    Messaggi
    1,117

    Commit e Rollback da codice...

    Ciao, sto "pasticciando" con il commit e begintransaction

    Da un metodo principale (all'interno di una begin trasaction) richiamo altre
    classi che eseguono a loro volta altre transazioni che terminato tutte con
    commit/rollback

    nel commit del metodo principale ottengo però questo errore

    La SqlTransaction è completata e non può più essere utilizzata.

    Cosa può essere??

    Inner.Commit();


    in System.Data.SqlClient.SqlTransaction.ZombieCheck()
    in System.Data.SqlClient.SqlTransaction.Commit()
    in
    System.Windows.Forms.ToolBar.OnButtonClick(ToolBar ButtonClickEventArgs
    e)
    in System.Windows.Forms.ToolBar.WmReflectCommand(Mess age& m)
    in System.Windows.Forms.ToolBar.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    in System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
    Int32 msg, IntPtr wparam, IntPtr lparam)
    in System.Windows.Forms.UnsafeNativeMethods.SendMessa ge(HandleRef hWnd,
    Int32 msg, IntPtr wParam, IntPtr lParam)
    in System.Windows.Forms.Control.SendMessage(Int32 msg, IntPtr wparam,
    IntPtr lparam)
    in System.Windows.Forms.Control.ReflectMessageInterna l(IntPtr hWnd,
    Message& m)
    in System.Windows.Forms.Control.WmCommand(Message& m)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
    in System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
    in System.Windows.Forms.Form.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    in System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
    Int32 msg, IntPtr wparam, IntPtr lparam)
    in System.Windows.Forms.UnsafeNativeMethods.CallWindo wProc(IntPtr
    wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    in System.Windows.Forms.NativeWindow.DefWndProc(Messa ge& m)
    in System.Windows.Forms.Control.DefWndProc(Message& m)
    in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
    button, Int32 clicks)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in System.Windows.Forms.ToolBar.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
    in System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd,
    Int32 msg, IntPtr wparam, IntPtr lparam)
    in System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
    in
    System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32
    dwComponentID, Int32 reason, Int32 pvLoopData)
    in
    System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32
    reason, ApplicationContext context)
    in System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32
    reason, ApplicationContext context)
    in System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
    in System.Windows.Forms.Form.ShowDialog()
    in MainClass..ctor(String StartApp) in MainClass.cs:riga 829
    in MainClass.Main() in MainClass.cs:riga 661
    in System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
    in System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence
    assemblySecurity, String[] args)
    in Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
    in System.Threading.ThreadHelper.ThreadStart_Context( Object state)
    in System.Threading.ExecutionContext.Run(ExecutionCon text
    executionContext, ContextCallback callback, Object state)
    in System.Threading.ThreadHelper.ThreadStart()

  2. #2
    Detta cosi e' un po' difficile. La transazione e' legata alla connection. Bisognerebbe verificare tutti i vari passaggi che la connection fa e l'eventuale errata presenza di piu' commit.
    Saluti a tutti
    Riccardo

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.