I think you need to create a transactionscope yourself like:
TransactionScope transaction = new TransactionScope();
then you can use and pass it around as you like. Or what am I missing?

And then you need a function like this to get the database connection
and enlist it in the transaction:
    Public Function getSQLCommand() As IDbCommand
        Dim sess As ISession
        'activerecord kry session wat connection bevat
        sess = 
ActiveRecordMediator.GetSessionFactoryHolder().CreateSession(GetType(ActiveRecordBase))


        'kry connnection vanaf activerecord session en create command
        Dim com As IDbCommand = sess.Connection.CreateCommand()
        If sess.Transaction.IsActive Then
            sess.Transaction.Enlist(com)
        End If

        Return com
    End Function

~Gerdus

On Wed, Sep 2, 2009 at 3:46 AM, the.wizard<[email protected]> wrote:
>
> Hi everyone,
> Does anyone know how to get the session object in castle active record
> when doing a transaction? I want to perform a transaction that consist
> of a direct save using Castle Active Record object, and using a stored
> procedure, and I need the session object to pass it to my method that
> execute my stored procedure.
> Please help me, I have already frustated with this problem, have been
> looking all over internet, but can't find one to solve this problem.
> Really thanks a lot.
>
> Regards.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to