Transaction - InfoPath Dev
in

InfoPath Dev

Transaction

Last post 12-02-2008 10:56 AM by AliMalek. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 11-27-2008 01:50 PM

    Transaction

    Hi,

    How can I get rid of begin transaction and rollback that Infopath puts around any data change I have in user interface preview form? I would like to be able to test my form.

     Thank

    Ali

  • 11-28-2008 01:19 PM In reply to

    Any feedback?

    I use something like the following code when I need to save data fields on SQL Server:

    XDocument.QueryAdapter.Command = "exec dbo.SaveSQLComplexDBinfo " + SQLComplexDBID + ",'" + ComplexName + "','" + DBName + "','" + AppCode + "'";
    XDocument.Query();

    When I check database activity, I see that something like this will be issued to SQL Server:

    set implicit_transactions on SET NO_BROWSETABLE ON
    exec dbo.SaveSQLComplexDBinfo 96,SQLDA-CX02','ATT25','ACTT'
    IF @@TRANCOUNT > 0 ROLLBACK TRAN

    I need the data to be saved. Why does Query() method wrap the actual query in a transaction and how can I prevent that?

    Thanks

     

  • 12-01-2008 01:12 PM In reply to

    I do know that when IP queries, the first query call will be to create the schema, the second query call with actually execute the sproc. This post has a little info on that.... When you test the form, does your sproc execute?

    Hilary Stoupa

  • 12-01-2008 01:31 PM In reply to

    Sorry, I don't know what do you refer to as "IP Query" and can't find any similarity between my case and the one in your posting.

  • 12-01-2008 03:49 PM In reply to

    Actually, the post I refer to, the second entry, he refers to the behavior of calling the stored procedure twice, once to generate schema. By "IP Query" I meant "InfoPath Query". I apologize for being unclear. What happens when you run your form and it actually calls the stored procedure? Is your data saved to the database?

    Hilary Stoupa

  • 12-01-2008 05:29 PM In reply to

    Thanks for clarification. When I publish the form on sharepoint and fill it, clicking on save button (uses the code specified above), will put implicit transaction before and rollback after stored procedure call.

  • 12-01-2008 05:36 PM In reply to

    So when you publish the form and fill it out, the data is not saved to the database, is that correct?

    I understand what you are saying about the implicit transaction and rollback, but in my experience InfoPath only does this the first time it makes the database call, to generate the schema, then it runs the procedure again, without the rollback.

    Hilary Stoupa

  • 12-02-2008 06:22 AM In reply to

    Yes, It doesn't save the data.

    It always puts rollback after stored procedure call.

  • 12-02-2008 09:53 AM In reply to

    You can workaround the rollback by adding a begin transaction/commit transaction to your query command or the stored procedure.

  • 12-02-2008 10:56 AM In reply to

    I can't because the outer implicit transaction definition will cause the inner transaction to be rolled back.

Page 1 of 1 (10 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.