Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Wrapping a transaction around 2 StoredProcedure calls?
 

Pages: 1
LLBLGen Pro Runtime Framework
Wrapping a transaction around 2 StoredProcedure calls?
Page:1/1 

  Print all messages in this thread  
Poster Message
ianvink
User



Location:

Joined on:
15-Dec-2006 02:36:45
Posted:
358 posts
# Posted on: 06-Feb-2013 00:58:14.  
Using the Entity Framework 4.0

I have 2 Stored Procedure Calls generated by LLBL which look like this:

Code:
        public int CallFIRST(System.String userId, System.String clientIds)
        {
            var cmd = CreateStoredProcCallCommand("[dbo].[usp_ABC]", true);
            AddParameter(cmd, "@USER_ID", 64, ParameterDirection.Input, userId);
            var toReturn = ExecuteNonQueryCommand(cmd);
            return toReturn;
        }

        public int CallSECOND(System.String userId, System.String clientIds)
        {
            var cmd = CreateStoredProcCallCommand("[dbo].[usp_123]", true);
            AddParameter(cmd, "@USER_ID", 64, ParameterDirection.Input, userId);
            var toReturn = ExecuteNonQueryCommand(cmd);
            return toReturn;
        }



How do I call them both inside 1 transaction?
  Top
daelmo
Support Team



Location:
Guatemala City
Joined on:
28-Nov-2005 23:35:24
Posted:
8071 posts
# Posted on: 06-Feb-2013 06:46:11.  
You could create your own method (CallMyTwoSPs) in a partial class, get the connection, open it, begin the transaction, call yous two SPs methods, then commit.

David Elizondo
LLBLGen'ing (articles and code snippets) | linkedin | twitter
 
Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.