﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Transaction Commit problem</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 27 Apr 2026 15:14:14 GMT</lastBuildDate><ttl>20</ttl><item><title>Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23874.aspx</link><description>Hi,&lt;br&gt;
I deploy to customer my application. On my developer machine all works fine.. and as always on customer side all goes wrong :)&lt;br&gt;
The code is simple as on example&lt;br&gt;
[code]&lt;br&gt;
      Try&lt;br&gt;
            BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", lcTransactionKey, Data.IsolationLevel.ReadCommitted)&lt;br&gt;
            mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
&lt;br&gt;
            lSaveResult = loPSOFormStoreBO.Save(True, lcTransactionKey)&lt;br&gt;
            If lSaveResult = MicroFour.StrataFrame.Data.SaveUndoResult.Success Then&lt;br&gt;
                BusinessLayer.TransactionCommit("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
                lcErrorMessage = "SUCCESS"&lt;br&gt;
            Else&lt;br&gt;
                Throw New Exception("An error happen during save data!")&lt;br&gt;
            End If&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
            lcErrorMessage = ex.Message&lt;br&gt;
            BusinessLayer.TransactionRollback("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
        End Try&lt;br&gt;
[/code]&lt;br&gt;
&lt;br&gt;
On customer machine BusinessLayer.TransactionCommit call an exception (free translation from german) Transaction is finised and can't be used anymore.. something like that...&lt;br&gt;
The question is WHEN transaction is finished? :) and why on my developer machine all works fine and there an exception happens.&lt;br&gt;
Everywhere installed SQL Server 2008.&lt;br&gt;
Any ideas&lt;br&gt;
Thanks&lt;br&gt;
Denis</description><pubDate>Thu, 23 Jul 2009 13:53:27 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23907.aspx</link><description>What Edhy mentioned is exactly what I was getting at.  There is no reason to do this on the customers site.  I am suggesting that you build a simple EXE that you can run and test against.  This is how I isolate problems within my code as well.</description><pubDate>Thu, 23 Jul 2009 13:53:27 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23904.aspx</link><description>[quote][b]Edhy Rijo (07/23/2009)[/b][hr][quote][b]dgsoft (07/23/2009)[/b][hr]... but that does not mean that you have a real issue here.[/quote]&lt;br&gt;
&lt;br&gt;
Sorry this should have read:&lt;br&gt;
[quote]... but that does not mean that you [u]don't have[/u] a real issue here. :hehe:[/quote]</description><pubDate>Thu, 23 Jul 2009 11:17:03 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23903.aspx</link><description>[quote][b]dgsoft (07/23/2009)[/b][hr]Hi,&lt;br&gt;
All good what you say but then I need a StrataFrame license on cusomer side.. to buid such examples. On developer machine I have no problems without any examples.[/quote]&lt;br&gt;
&lt;br&gt;
Hi Denis,&lt;br&gt;
&lt;br&gt;
Trent was not suggesting you build a sample at the customer site.  What I understand from his previous message is that it would be good to build another test project with just 2 tables and 2 BO so you can test on an easy to reproduce project to help you find what the issue is.  &lt;br&gt;
&lt;br&gt;
I use transactions all the time using basically the same code as yours, except that I do not make any changes to the BO properties after the transaction begins and so far have not found any problems, but that does not mean that you have a real issue here.</description><pubDate>Thu, 23 Jul 2009 11:14:34 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23902.aspx</link><description>Hi,&lt;br&gt;
All good what you say but then I need a StrataFrame license on cusomer side.. to buid such examples. On developer machine I have no problems without any examples.&lt;br&gt;
I am currently remove all transactions from my code.. because I have realy a stress by my work.. its shortest solution already work.. and maybe in future.. I will add transactions again when I understand whats wrong.. and will have more time to play instead work.&lt;br&gt;
&lt;br&gt;
Thanks for attention&lt;br&gt;
Denis</description><pubDate>Thu, 23 Jul 2009 11:07:08 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23901.aspx</link><description>Well, you might be chasing your tail (I have been known to do that from time to time :D).  We store off a cache of transaction keys, so it is actually NOT recommended to use the same transaction key for different processes that could be going on at the same time.  For example, if I am going to save 2 BOs on the same transaction during the same process, that is fine as I would want to use the same transaction key.  However, if there is potential for there to be two separate process try to start a transaction on the same key at the same time, it will fail.  So procedure could be the difference at run-time versus design-time.&lt;br&gt;
&lt;br&gt;
One thing I might suggest is creating a sample for you to work off of that is simple so you can isolate the issue.  For example, create a single table (or two if that is what your test requires) on a test database.  Then create a new project, one (or two) BOs, then create a single button that creates the transaction, creates the records, and saves.  If this works in both environments, then you will know exactly where your issue resides.  I generally take this type of approach on errors like this so I can isolate the issue.  Once isolated, it is far easier to see what is going on within the application at large.</description><pubDate>Thu, 23 Jul 2009 10:50:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23899.aspx</link><description>Hi Trent,&lt;br&gt;
Thanks for response.&lt;br&gt;
1) I shutdown developer SQL Server 2008 - and copy MDF file and upload to customer by FTP&lt;br&gt;
2) Download MDF file and copy it to the Programme\Microsoft SQL Server\ MSSQL10.MSSQLSERVER\MSSQL\DATA on customer side&lt;br&gt;
3) Attach database to customer SQL Server 2008&lt;br&gt;
4) On Developer SQL Server - no problem. All works as expect&lt;br&gt;
5) On customer side problems begins with Error message &lt;br&gt;
A transaction with the key [PENSOLUTIONOFFICE] is already started. (at this time I used same name for all transactions.. and I thought during my code one transaction begins and not finished with rollback or commit.. probably crush or cancel debugging&lt;br&gt;
6) Then I change my code and began generate unique GUID string as key for all new transactions.&lt;br&gt;
7) Then I have error message about transaction is closed and can't be used.&lt;br&gt;
8) Then I made for test changes.. fill business object by primary, change nothing .. Save()  Commit() - all works&lt;br&gt;
9) Then I change one field of BO and try Save()..  Commit() - and then error happens again.&lt;br&gt;
&lt;br&gt;
So this is what I have now.</description><pubDate>Thu, 23 Jul 2009 09:32:01 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23898.aspx</link><description>OK, let's back up several steps and talk a little logic and maybe we can work through this.&lt;br&gt;
&lt;br&gt;
First of all, a ZombieCheck is a piece of an SQL Transaction looking for a stale (or closed) transaction.  This is intrinsic to the Sql Client, and is correct in checking.  But another thing that I would like to revisit here, as there was a lot of chatter, but the thing that struck me was this: [i]when you copied over the MDF from your development machine, it worked[/i].&lt;br&gt;
&lt;br&gt;
Put all of the code aside.  If your code was left intact and you ran this against two different databases and it worked on the one created in your development server (MDF) and the same code failed when run against the production server, then there is most definitely a SQL side issue.&lt;br&gt;
&lt;br&gt;
Please confirm that what I have said is accurate before I go down another path.  Thanks.</description><pubDate>Thu, 23 Jul 2009 08:40:46 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23895.aspx</link><description>And the last idea what I have...&lt;br&gt;
When I made BO.SAVE() - because BO has timestamp - then after changes commited, BusinessObject make FILL to refresh new timestamp.. and FILL close connection.. and - seems then TransactionCommit has no more mind - because connection is closed.&lt;br&gt;
Of couse I use BO.SAVE(true, lcTransactionKey) - and on my developer machine I have not a problem.. - this is strange... but diffrence only.. all my business objects stored in separate DLL.. and from aspx I just reference this dll.. createobject.. and so on..&lt;br&gt;
TransactionBegin - running in aspx... BO.SAVE() occurs in DLL... TransactionCommit() also in the aspx...&lt;br&gt;
&lt;br&gt;
So.. I realy need help ... don't know what to do :(</description><pubDate>Thu, 23 Jul 2009 01:28:37 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23894.aspx</link><description>Just idea&lt;br&gt;
Maybe the code close the connection without completing the Transact-SQL transaction.  &lt;br&gt;
So.. I use business object in separate dll and transactionBegin and TransactionCommit in aspx file. Is there on BO.Save() connection is closed? and then.. Transaction is no more control a connection.. or? &lt;br&gt;
Or I request another connection and receive the previous connection from the connection pool.. so its seems also possible...&lt;br&gt;
&lt;br&gt;
Please any ideas</description><pubDate>Thu, 23 Jul 2009 01:05:50 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23893.aspx</link><description>This is error message details..&lt;br&gt;
Transaction still does not work. I had restart a SQL Server.&lt;br&gt;
What is ZombieCheck is?</description><pubDate>Thu, 23 Jul 2009 00:55:02 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23892.aspx</link><description>I made so&lt;br&gt;
            mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
            BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", lcTransactionKey, Data.IsolationLevel.ReadUncommitted)&lt;br&gt;
&lt;br&gt;
and have no success.. same error.. about transaction end and can't be used..&lt;br&gt;
&lt;br&gt;
I give up  for today.. now is 01:19 am in Moscow :) Maybe morning bring something :) &lt;br&gt;
Thanks for your help!&lt;br&gt;
See ya!&lt;br&gt;
Denis</description><pubDate>Wed, 22 Jul 2009 16:13:31 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23891.aspx</link><description>This quote is from the "Using Transactional Processing" topic in the SF help file:&lt;br&gt;
[quote]Transaction processing is often used to implement pessimistic concurrency.  Database tables participating in the transaction can be locked, depending on the IsolationLevel used when the transaction was started.  This prevents client applications other than the transaction owner from modifying the tables while the transaction is processing. [/quote]&lt;br&gt;
&lt;br&gt;
Since you are using ReadCommitted Isolation Level and then modifying the BO properties, then the transaction triggers an error.  I believe you have two options here:&lt;br&gt;
1-Move mmks_updatePSOForm() before TransactionBeign &lt;br&gt;
2-Change the Isolation Level to ReadUncommitted&lt;br&gt;
&lt;br&gt;
Also check this KB: [url=]http://msdn.microsoft.com/en-us/library/ms173763.aspx[/url]&lt;br&gt;
&lt;br&gt;
Try boths and let me know.&lt;br&gt;
&lt;br&gt;</description><pubDate>Wed, 22 Jul 2009 16:04:37 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23890.aspx</link><description>Yes.&lt;br&gt;
Even if I leave only one line for update&lt;br&gt;
toBO.filename = Me.PSOForm_filename.Text&lt;br&gt;
&lt;br&gt;
TransactionCommit fail in any case..&lt;br&gt;
&lt;br&gt;
Yes. I change order of lines and try update befor TransactionBegin.. it does not help...&lt;br&gt;
For this business object I use RowVersionOrTimestampColumn - timestamp&lt;br&gt;
UpdateConcurrencyType - OptimisticTimestamp</description><pubDate>Wed, 22 Jul 2009 15:58:48 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23889.aspx</link><description>Good, so the problem is here:&lt;br&gt;
[codesnippet]&lt;br&gt;
Private Sub mmks_updatePSOForm(ByVal toBO As PSOFormStoreBO)&lt;br&gt;
&lt;br&gt;
Dim lcXformXML As String = ""&lt;br&gt;
If Me.FileUploadXForm.HasFile() = True Then&lt;br&gt;
Dim loStreadReader As StreamReader = New StreamReader(Me.FileUploadXForm.PostedFile.InputStream)&lt;br&gt;
lcXformXML = loStreadReader.ReadToEnd()&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
toBO.filename = Me.PSOForm_filename.Text&lt;br&gt;
toBO.formsetid = Me.PSOForm_formsetid.Text&lt;br&gt;
toBO.validForm = Me.PSOForm_validFrom.Value&lt;br&gt;
toBO.validto = Me.PSOForm_validTo.Value&lt;br&gt;
toBO.papersize = Me.PSOForm_Papersize.Value&lt;br&gt;
toBO.topage = Me.PSOForm_topage.Value&lt;br&gt;
toBO.frompage = Me.PSOForm_fromPage.Value&lt;br&gt;
toBO.comment = Me.PSOForm_HtmlEditor1.Text&lt;br&gt;
&lt;br&gt;
If Not String.IsNullOrEmpty(lcXformXML) Then&lt;br&gt;
toBO.xformxml = lcXformXML&lt;br&gt;
End If&lt;br&gt;
&lt;br&gt;
End Sub &lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;
As I understand it you are sending your BO as toBO to update some properties.  Did you try calling mmks_updatePSOForm() before TransactionBeign...?&lt;br&gt;</description><pubDate>Wed, 22 Jul 2009 15:53:54 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23888.aspx</link><description>Please look my last comment.. I thinking I localize the problem untill one line of code :)</description><pubDate>Wed, 22 Jul 2009 15:34:32 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23887.aspx</link><description>Now I get closer to my problem..&lt;br&gt;
&lt;br&gt;
Please look...&lt;br&gt;
[code]&lt;br&gt;
       Try&lt;br&gt;
            BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", lcTransactionKey, Data.IsolationLevel.ReadCommitted)&lt;br&gt;
''' ************************************************************************************&lt;br&gt;
''' HERE I UPDATE BUSINESS OBJECT PROPERTIES            mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
''' IF I UPDATE ONE or ANY PROPERTIES OF BO - then SAVE() works perfect but TransactionCommit - FAIL&lt;br&gt;
'' IF I DO NOT UPDATE ANY PROPERTIES OF BO - then TransactionCommit SUCCESS!!!!!&lt;br&gt;
''' *************************************************************************************&lt;br&gt;
            MicroFour.StrataFrame.Data.DataBasics.DataSources("PENSOLUTIONOFFICE").SetDebugOn("c:\DebugFile.html", True)&lt;br&gt;
            lSaveResult = loPSOFormStoreBO.Save(True, lcTransactionKey)&lt;br&gt;
            If lSaveResult = MicroFour.StrataFrame.Data.SaveUndoResult.Success Then&lt;br&gt;
                BusinessLayer.TransactionCommit("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
                lcErrorMessage = "SUCCESS"&lt;br&gt;
            Else&lt;br&gt;
                Throw New Exception("An error happen during save data!")&lt;br&gt;
            End If&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
            lcErrorMessage = ex.Message&lt;br&gt;
            BusinessLayer.TransactionRollback("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
        End Try&lt;br&gt;
[code]&lt;br&gt;
&lt;br&gt;
The diffrence between developer machine and customer machine where I currently debug it with Visual Studio.. &lt;br&gt;
&lt;br&gt;
on development machine I have included PenSolutionOfficeBO as Project.. but&lt;br&gt;
on customer machine - its only DLL which located in BIN folder.&lt;br&gt;
&lt;br&gt;
So.. any ideas now?&lt;br&gt;
&lt;br&gt;
Thanks!&lt;br&gt;</description><pubDate>Wed, 22 Jul 2009 15:33:36 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23886.aspx</link><description>I really don't see anything wrong, so at this point is just to try and error unless Trent or somebody else have another suggestion.&lt;br&gt;
&lt;br&gt;
Try moving the code mmks_updatePSOForm(loPSOFormStoreBO) before the TransactionBegin...&lt;br&gt;
&lt;br&gt;
[codesnippet]&lt;br&gt;
mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", lcTransactionKey, Data.IsolationLevel.ReadCommitted)&lt;br&gt;
[/codesnippet]&lt;br&gt;
&lt;br&gt;</description><pubDate>Wed, 22 Jul 2009 15:29:52 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23885.aspx</link><description>Sorry.. I copy wrong code :))))&lt;br&gt;
&lt;br&gt;
[code]&lt;br&gt;
&lt;br&gt;
   &lt;AjaxMethod()&gt; _&lt;br&gt;
    Public Function mmks_save() As String&lt;br&gt;
        Dim lcErrorMessage As String = "SUCCESS"&lt;br&gt;
        Dim lcTransactionKey As String = Guid.NewGuid().ToString()&lt;br&gt;
        Dim llNewUser As Boolean = pmks_form_Id &lt; 0&lt;br&gt;
        Dim lSaveResult As MicroFour.StrataFrame.Data.SaveUndoResult&lt;br&gt;
        Dim lcUploadErrorMessage As String = ""&lt;br&gt;
        Dim loPSOFormStoreBO As PSOFormStoreBO = New PSOFormStoreBO()&lt;br&gt;
        If llNewUser Then&lt;br&gt;
            loPSOFormStoreBO.Add()&lt;br&gt;
        Else&lt;br&gt;
            loPSOFormStoreBO.FillByPrimaryKey(pmks_form_Id)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        If Me.FileUploadPng.HasFile() = True Then&lt;br&gt;
            Dim lcFormName As String = Me.PSOForm_filename.Text&lt;br&gt;
            Dim lcFormStem As String = ""&lt;br&gt;
            If lcFormName.IndexOf(".") &gt; 0 Then&lt;br&gt;
                Dim lcFormStems As String() = lcFormName.Split(".")&lt;br&gt;
                lcFormStem = lcFormStems(0)&lt;br&gt;
            Else&lt;br&gt;
                lcFormStem = lcFormName&lt;br&gt;
            End If&lt;br&gt;
&lt;br&gt;
            If Not String.IsNullOrEmpty(lcFormStem) Then&lt;br&gt;
                Dim rootpath As String = Server.MapPath("~/")&lt;br&gt;
                Dim lcMandatorPath As String = rootpath + Session("session_mandator_name") + "\"&lt;br&gt;
                Dim loDirectoryInfo As DirectoryInfo = New DirectoryInfo(lcMandatorPath)&lt;br&gt;
                If Not loDirectoryInfo.Exists() Then&lt;br&gt;
                    loDirectoryInfo.Create()&lt;br&gt;
                End If&lt;br&gt;
                Dim lcFormPath As String = lcMandatorPath + lcFormStem + "\"&lt;br&gt;
                loDirectoryInfo = New DirectoryInfo(lcFormPath)&lt;br&gt;
                If Not loDirectoryInfo.Exists() Then&lt;br&gt;
                    loDirectoryInfo.Create()&lt;br&gt;
                End If&lt;br&gt;
                Try&lt;br&gt;
                    Me.FileUploadPng.PostedFile.SaveAs(lcFormPath + Path.GetFileName(Me.FileUploadPng.FileName))&lt;br&gt;
                Catch ex As Exception&lt;br&gt;
                    lcUploadErrorMessage = ex.Message&lt;br&gt;
                End Try&lt;br&gt;
&lt;br&gt;
            End If&lt;br&gt;
&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        Try&lt;br&gt;
            BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", lcTransactionKey, Data.IsolationLevel.ReadCommitted)&lt;br&gt;
            mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
            MicroFour.StrataFrame.Data.DataBasics.DataSources("PENSOLUTIONOFFICE").SetDebugOn("c:\DebugFile.html", True)&lt;br&gt;
            lSaveResult = loPSOFormStoreBO.Save(True, lcTransactionKey)&lt;br&gt;
            If lSaveResult = MicroFour.StrataFrame.Data.SaveUndoResult.Success Then&lt;br&gt;
                BusinessLayer.TransactionCommit("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
                lcErrorMessage = "SUCCESS"&lt;br&gt;
            Else&lt;br&gt;
                Throw New Exception("An error happen during save data!")&lt;br&gt;
            End If&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
            lcErrorMessage = ex.Message&lt;br&gt;
            BusinessLayer.TransactionRollback("PENSOLUTIONOFFICE", lcTransactionKey)&lt;br&gt;
        End Try&lt;br&gt;
        Return (lcErrorMessage)&lt;br&gt;
&lt;br&gt;
[/code]</description><pubDate>Wed, 22 Jul 2009 15:06:16 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23884.aspx</link><description>This is complete method code&lt;br&gt;
&lt;br&gt;
In my case llNewUser = .F. and pmks_form_id has correct integer value&lt;br&gt;
&lt;br&gt;
 &lt;AjaxMethod()&gt; _&lt;br&gt;
    Public Function mmks_save() As String&lt;br&gt;
        Dim lcErrorMessage As String = "SUCCESS"&lt;br&gt;
        Dim llNewUser As Boolean = pmks_form_Id &lt; 0&lt;br&gt;
        Dim lSaveResult As MicroFour.StrataFrame.Data.SaveUndoResult&lt;br&gt;
        Dim lcUploadErrorMessage As String = ""&lt;br&gt;
        Dim loPSOFormStoreBO As PSOFormStoreBO = New PSOFormStoreBO()&lt;br&gt;
        If llNewUser Then&lt;br&gt;
            loPSOFormStoreBO.Add()&lt;br&gt;
        Else&lt;br&gt;
            loPSOFormStoreBO.FillByPrimaryKey(pmks_form_Id)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        If Me.FileUploadPng.HasFile() = True Then&lt;br&gt;
            Dim lcFormName As String = Me.PSOForm_filename.Text&lt;br&gt;
            Dim lcFormStem As String = ""&lt;br&gt;
            If lcFormName.IndexOf(".") &gt; 0 Then&lt;br&gt;
                Dim lcFormStems As String() = lcFormName.Split(".")&lt;br&gt;
                lcFormStem = lcFormStems(0)&lt;br&gt;
            Else&lt;br&gt;
                lcFormStem = lcFormName&lt;br&gt;
            End If&lt;br&gt;
&lt;br&gt;
            If Not String.IsNullOrEmpty(lcFormStem) Then&lt;br&gt;
                Dim rootpath As String = Server.MapPath("~/")&lt;br&gt;
                Dim lcMandatorPath As String = rootpath + Session("session_mandator_name") + "\"&lt;br&gt;
                Dim loDirectoryInfo As DirectoryInfo = New DirectoryInfo(lcMandatorPath)&lt;br&gt;
                If Not loDirectoryInfo.Exists() Then&lt;br&gt;
                    loDirectoryInfo.Create()&lt;br&gt;
                End If&lt;br&gt;
                Dim lcFormPath As String = lcMandatorPath + lcFormStem + "\"&lt;br&gt;
                loDirectoryInfo = New DirectoryInfo(lcFormPath)&lt;br&gt;
                If Not loDirectoryInfo.Exists() Then&lt;br&gt;
                    loDirectoryInfo.Create()&lt;br&gt;
                End If&lt;br&gt;
                Try&lt;br&gt;
                    Me.FileUploadPng.PostedFile.SaveAs(lcFormPath + Path.GetFileName(Me.FileUploadPng.FileName))&lt;br&gt;
                Catch ex As Exception&lt;br&gt;
                    lcUploadErrorMessage = ex.Message&lt;br&gt;
                End Try&lt;br&gt;
&lt;br&gt;
            End If&lt;br&gt;
&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        Try&lt;br&gt;
            BusinessLayer.TransactionBegin("PENSOLUTIONOFFICE", "PENSOLUTIONOFFICE", Data.IsolationLevel.ReadCommitted)&lt;br&gt;
            mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
&lt;br&gt;
            lSaveResult = loPSOFormStoreBO.Save(True, "PENSOLUTIONOFFICE")&lt;br&gt;
            If lSaveResult = MicroFour.StrataFrame.Data.SaveUndoResult.Success Then&lt;br&gt;
                BusinessLayer.TransactionCommit("PENSOLUTIONOFFICE", "PENSOLUTIONOFFICE")&lt;br&gt;
                lcErrorMessage = "SUCCESS"&lt;br&gt;
            Else&lt;br&gt;
                Throw New Exception("An error happen during save data!")&lt;br&gt;
            End If&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
            lcErrorMessage = ex.Message&lt;br&gt;
            BusinessLayer.TransactionRollback("PENSOLUTIONOFFICE", "PENSOLUTIONOFFICE")&lt;br&gt;
        End Try&lt;br&gt;
        Return (lcErrorMessage)&lt;br&gt;
    End Function</description><pubDate>Wed, 22 Jul 2009 15:03:02 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23883.aspx</link><description>Its just to set values for BO properties&lt;br&gt;
&lt;br&gt;
  Private Sub mmks_updatePSOForm(ByVal toBO As PSOFormStoreBO)&lt;br&gt;
&lt;br&gt;
        Dim lcXformXML As String = ""&lt;br&gt;
        If Me.FileUploadXForm.HasFile() = True Then&lt;br&gt;
            Dim loStreadReader As StreamReader = New StreamReader(Me.FileUploadXForm.PostedFile.InputStream)&lt;br&gt;
            lcXformXML = loStreadReader.ReadToEnd()&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        toBO.filename = Me.PSOForm_filename.Text&lt;br&gt;
        toBO.formsetid = Me.PSOForm_formsetid.Text&lt;br&gt;
        toBO.validForm = Me.PSOForm_validFrom.Value&lt;br&gt;
        toBO.validto = Me.PSOForm_validTo.Value&lt;br&gt;
        toBO.papersize = Me.PSOForm_Papersize.Value&lt;br&gt;
        toBO.topage = Me.PSOForm_topage.Value&lt;br&gt;
        toBO.frompage = Me.PSOForm_fromPage.Value&lt;br&gt;
         toBO.comment = Me.PSOForm_HtmlEditor1.Text&lt;br&gt;
&lt;br&gt;
        If Not String.IsNullOrEmpty(lcXformXML) Then&lt;br&gt;
            toBO.xformxml = lcXformXML&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    End Sub</description><pubDate>Wed, 22 Jul 2009 14:59:46 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23882.aspx</link><description>Also.. one comment.. If I remove transaction.. code does not call any error. and data saves.. :unsure:</description><pubDate>Wed, 22 Jul 2009 14:57:39 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23881.aspx</link><description>What is this function doing: mmks_updatePSOForm(loPSOFormStoreBO)&lt;br&gt;
&lt;br&gt;</description><pubDate>Wed, 22 Jul 2009 14:56:55 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23880.aspx</link><description>Thanks for response&lt;br&gt;
yes.. database is a same.. I copy MDF file and attach it on customer side&lt;br&gt;
Save is not a problem.. it works..&lt;br&gt;
&lt;br&gt;
the debug file:&lt;br&gt;
Command #: 	1 &lt;br&gt;
Timestamp: 	2009-07-22 21:37:35.93 &lt;br&gt;
General Command Settings &lt;br&gt;
Command Type: 	Text &lt;br&gt;
Object Type: 	System.Data.SqlClient.SqlCommand &lt;br&gt;
Connection String: 	Data Source=DIGIPENDEV2;Initial Catalog=AnotoOffice;User ID=anoto; &lt;br&gt;
Transaction: 	True &lt;br&gt;
Command Settings &lt;br&gt;
CommandText: 	UPDATE [dbo].[PSOFormstore] SET [mandator_id] = @mandator_id, [filename] = @filename, [formsetid] = @formsetid, [active] = @active, [validForm] = @validForm, [validto] = @validto, [offsetx] = @offsetx, [offsety] = @offsety, [patternscalex] = @patternscalex, [patternscaley] = @patternscaley, [mergeOpenValue] = @mergeOpenValue, [mergeOpenUnit] = @mergeOpenUnit, [comment] = @comment, [pivotx] = @pivotx, [pivoty] = @pivoty, [rotate] = @rotate, [fs_us_pk] = @fs_us_pk, [xformxml] = @xformxml, [papersize] = @papersize, [frompage] = @frompage, [topage] = @topage WHERE [id] = @id AND (([timestamp] = @timestamp) OR (@timestamp IS NULL)); SELECT [timestamp] FROM [dbo].[PSOFormstore] WHERE [id] = @id; &lt;br&gt;
Command Parameters &lt;br&gt;
@mandator_id: 	'0' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: mandator_id | SourceVersion: Current] &lt;br&gt;
@filename: 	'Hartl_Besprechungsformular_Seite1.xform' [DbType: AnsiString | Size: 66 | Direction: Input | SourceColumn: filename | SourceVersion: Current] &lt;br&gt;
@formsetid: 	'Hartl_Besprechungsformular' [DbType: AnsiString | Size: 66 | Direction: Input | SourceColumn: formsetid | SourceVersion: Current] &lt;br&gt;
@active: 	'255' [DbType: Byte | Size: 1 | Direction: Input | SourceColumn: active | SourceVersion: Current] &lt;br&gt;
@validForm: 	'01.06.2009 00:00:00' [DbType: DateTime | Size: 0 | Direction: Input | SourceColumn: validForm | SourceVersion: Current] &lt;br&gt;
@validto: 	'11.06.2009 00:00:00' [DbType: DateTime | Size: 0 | Direction: Input | SourceColumn: validto | SourceVersion: Current] &lt;br&gt;
@offsetx: 	'0' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: offsetx | SourceVersion: Current] &lt;br&gt;
@offsety: 	'0' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: offsety | SourceVersion: Current] &lt;br&gt;
@patternscalex: 	'1' [DbType: Double | Size: 0 | Direction: Input | SourceColumn: patternscalex | SourceVersion: Current] &lt;br&gt;
@patternscaley: 	'1' [DbType: Double | Size: 0 | Direction: Input | SourceColumn: patternscaley | SourceVersion: Current] &lt;br&gt;
@mergeOpenValue: 	'0' [DbType: Int16 | Size: 0 | Direction: Input | SourceColumn: mergeOpenValue | SourceVersion: Current] &lt;br&gt;
@mergeOpenUnit: 	'' [DbType: AnsiString | Size: 11 | Direction: Input | SourceColumn: mergeOpenUnit | SourceVersion: Current] &lt;br&gt;
@comment: 	'' [DbType: AnsiString | Size: 257 | Direction: Input | SourceColumn: comment | SourceVersion: Current] &lt;br&gt;
@pivotx: 	'0' [DbType: Double | Size: 0 | Direction: Input | SourceColumn: pivotx | SourceVersion: Current] &lt;br&gt;
@pivoty: 	'0' [DbType: Double | Size: 0 | Direction: Input | SourceColumn: pivoty | SourceVersion: Current] &lt;br&gt;
@rotate: 	'0' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: rotate | SourceVersion: Current] &lt;br&gt;
@fs_us_pk: 	'11' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: fs_us_pk | SourceVersion: Current] &lt;br&gt;
@xformxml: 	'' [DbType: AnsiString | Size: -1 | Direction: Input | SourceColumn: xformxml | SourceVersion: Current] &lt;br&gt;
@papersize: 	'A5' [DbType: AnsiString | Size: 13 | Direction: Input | SourceColumn: papersize | SourceVersion: Current] &lt;br&gt;
@frompage: 	'1' [DbType: Byte | Size: 1 | Direction: Input | SourceColumn: frompage | SourceVersion: Current] &lt;br&gt;
@topage: 	'1' [DbType: Byte | Size: 1 | Direction: Input | SourceColumn: topage | SourceVersion: Current] &lt;br&gt;
@id: 	'2' [DbType: Int32 | Size: 0 | Direction: Input | SourceColumn: id | SourceVersion: Original] &lt;br&gt;
@timestamp: 	'System.Byte[]' [DbType: Binary | Size: 8 | Direction: Input | SourceColumn: timestamp | SourceVersion: Current]</description><pubDate>Wed, 22 Jul 2009 14:39:26 GMT</pubDate><dc:creator>dgsoft</dc:creator></item><item><title>RE: Transaction Commit problem</title><link>http://forum.strataframe.net/FindPost23879.aspx</link><description>Also before the save, use code like this one to debug the data that is being send to the server:&lt;br&gt;
[codesnippet]&lt;br&gt;
MicroFour.StrataFrame.Data.DataBasics.DataSources("").SetDebugOn("c:\DebugFile.html", True)&lt;br&gt;
[/codesnippet]</description><pubDate>Wed, 22 Jul 2009 14:30:21 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item></channel></rss>