3 Replies Latest reply: Oct 16, 2012 1:08 PM by 896131 RSS

    TransactionScope Communication legacy application .NET 2.0 and .NET 4.0

      We have a legacy application (COM +) in writing .net 2.0. This application needs to make a call to an assembly written in .net 4.0. Application .net 2.0 initiates a transaction using TransactionScope. The data persisted in the application .net 2.0 are not visible in the application .net 4.0. The TransactionScope class is being used in its simplest form, with all default values in its constructor.

      When one removes the transaction, or if compiles the assembly .net 4.0 with .net 2.0 everything works perfectly.

      We are using the latest version of the ODP ( Database 10g.

      Any suggestions? This communication between different versions of the framework is that possible?
        • 1. Re: TransactionScope Communication legacy application .NET 2.0 and .NET 4.0
          gdarling - oracle
          Could you elaborate on the data not being visible in the application? It IS visible in the database, via sqlplus for example, just not in the app? Never? or Immediately?

          The only thing that comes to mind here, and I'm not sure why .net version would matter, is sometimes folks query data immediately after it was inserted, and there can be a short delay in the data being visible due to the way 2 phase commit works, if you have a distributed transaction (which you do, even if there's only a single connection in the transaction, since your db is 10g. In 11g transactions can actually be promoted so you start with a local transaction).

          Hope it helps,
          • 2. Re: TransactionScope Communication legacy application .NET 2.0 and .NET 4.0
            The transaction is initiated in version 2.0 of the framework. When do you call the assembly 4.0 transaction is still active. Thus, the data is not visible in other tool.


            'COM+ Framework 2.0
            Using Trans As New TransactionScope()
                 'Open connection
                 'Insert value in table with id = 1
                 'Create instance class Test Framework 4.0
                 Dim Obj As Object = CreateObject("ComponentDotNET4.Test")
            End Using

            'ComponentDotNet4.Test.MethodA Implementation
            Public Sub MethodA()
                 'Open connection
                 'Getting the value that was placed in the context of .NET 2.0
                 'The value is not visible
                 'As if it had not been inserted into database
                 Dim Value As String = GetValueTable(1)
            End Sub