Exception Details: System.Data.OracleClient.OracleException: ORA-01453: SET TRANSACTION must be first statement of transaction

Posts   
 
    
buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 03-Nov-2009 11:20:34   

ORA-01453: SET TRANSACTION must be first statement of transaction

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.OracleClient.OracleException: ORA-01453: SET TRANSACTION must be first statement of transaction

Source Error:

Line 412: } Line 413: Line 414: _dataservice.SaveEntity(webs, false); Line 415: Line 416: Response.Redirect("default.aspx");

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Nov-2009 11:38:09   

No much info in your post. (No version info, no code snippet and no stack trace).

Anyway please check the following thread (same exception): http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=15319

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39862
Joined: 17-Aug-2003
# Posted on: 03-Nov-2009 12:01:13   

likely caused by sharing of dataaccessadapter instance over multiple threads / requests.

Frans Bouma | Lead developer LLBLGen Pro
buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 03-Nov-2009 12:31:21   

Otis wrote:

likely caused by sharing of dataaccessadapter instance over multiple threads / requests.

so should all data services within my project be referenced with a indvidual name I have always called them _dataservice never had a problem before

buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 03-Nov-2009 12:39:38   

do you no how to solve this problem

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 03-Nov-2009 12:41:21   

it's not about naming, it's about instance sharing.

As it seems you have the _dataService as a member of the class and then it's shared between callers, right.

What's recommended is to have it locally defined within methods of the class, so it gets used and terminated once out of scope.

buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 03-Nov-2009 12:58:44   

Walaa wrote:

it's not about naming, it's about instance sharing.

As it seems you have the _dataService as a member of the class and then it's shared between callers, right.

What's recommended is to have it locally defined within methods of the class, so it gets used and terminated once out of scope.

so remove my dll and place the adapter code inside the scope of the source file then

MTrinder
User
Posts: 1461
Joined: 08-Oct-2008
# Posted on: 03-Nov-2009 20:41:59   

Not neccesarily - just have each call to your data layer create its own instance of the DataAccessAdapter, rather than having one persisted as a class member

Using the following method ensures the the adapter is always cleaned up properly when you have finished with it.



using (DataAccessAdapter daa = new DataAccessAdapter(connString)
{
   daa.SaveEntity...

}


Matt

buckd32
User
Posts: 20
Joined: 09-Oct-2009
# Posted on: 04-Nov-2009 11:23:40   

MTrinder wrote:

Not neccesarily - just have each call to your data layer create its own instance of the DataAccessAdapter, rather than having one persisted as a class member

Using the following method ensures the the adapter is always cleaned up properly when you have finished with it.



using (DataAccessAdapter daa = new DataAccessAdapter(connString)
{
   daa.SaveEntity...

}


Matt

I do this already with

    public void SaveEntity(IEntity2 entity, bool refetch)
    {

        using (DataAccessAdapter adapter = new DataAccessAdapter())
        {

            adapter.SaveEntity(entity, refetch, true);          
        }
    }
Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 04-Nov-2009 17:29:41   

mmm disappointed

Would you please provide the LLBLGen Pro runtime library version number. Also we will need the stack trace of the exception.