This discussion is archived
3 Replies Latest reply: Oct 16, 2012 11:08 AM by 896131 RSS

TransactionScope Communication legacy application .NET 2.0 and .NET 4.0

896131 Newbie
Currently Being Moderated
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 (11.2.0.3.20). 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 Expert
    Currently Being Moderated
    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,
    Greg
  • 2. Re: TransactionScope Communication legacy application .NET 2.0 and .NET 4.0
    896131 Newbie
    Currently Being Moderated
    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.

    Ilustration:

    'COM+ Framework 2.0
    Using Trans As New TransactionScope()
         
         'Open connection
         'Insert value in table with id = 1
         InsertValueTable(1)
         
         'Create instance class Test Framework 4.0
         Dim Obj As Object = CreateObject("ComponentDotNET4.Test")
         
         Obj.MethodA()
         
         Trans.Complete()
    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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points