Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Unable to call Storedprocedure with linked server #193


User avatar
0
nobruds created

Hello,

I'm not sure if this problem is from the abp but How can I execute a procedure with Liked server?

I'm getting the following error:

Unable to start a nested transaction for OLE DB provider "SQLNCLI10" for linked server "PINE_SQL". A nested transaction was required because the XACT_ABORT option was set to OFF. OLE DB provider "SQLNCLI10" for linked server "PINE_SQL" returned message "Cannot start more transactions on this session.".

My code on the Repository:

Session.CreateSQLQuery(
                    "EXEC BoletadorAtivos.dbo.blt_IntegracaoFuncaoCapitalGiroRegistro_sp @Operacao_ID = N'" + Operacao_ID + "'")
                    .ExecuteUpdate();

I just use the CreateSQLQuery from nhibernate.

My procedure tries to do an INSERT on another BD using Linked Server but fails, only SELECTS works with Linked Server.

Anybody has a clue why?

Thanks


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    This is not related to ABP, as you guess. I think probability of finding an answer harder in this forum since ABP community generally uses EF. You cam try to find on stackoverflow or similar sites.

    Thanks.

  • User Avatar
    0
    nobruds created

    Yes, sorry about that. I found it, will post here the answer if somebody needs, or you can delete the thread.

    Thanks

    SET XACT_ABORT { ON | OFF }
    
  • User Avatar
    0
    hikalkan created
    Support Team

    Thank you for information sharing ;)