﻿<?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?)  » Failed to save</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Thu, 17 Sep 2026 23:04:32 GMT</lastBuildDate><ttl>20</ttl><item><title>Failed to save</title><link>http://forum.strataframe.net/FindPost23018.aspx</link><description>Hi,&lt;br&gt;
I created this post to continue the problem I post at Memory leak thread. I am not sure should I add mine to the post "Transaction Fail".&lt;br&gt;
&lt;br&gt;
Anyway, I have created a simple project which reproduce the error I mentioned if save more than one BO within "same" transaction.&lt;br&gt;
&lt;br&gt;
Beside, I also attached screenshot to show the actual error happen before I call Rollback; Also, the screenshot that show "SqlTransaction has completed" error.&lt;br&gt;
&lt;br&gt;
As I found that, DataSource.Transactions[0].Connection become null just after the code below when first BO.Save() is called.&lt;br&gt;
&lt;br&gt;
[codesnippet]'-- UpdateDataTableThread()&lt;br&gt;
lnRowsAffected = Me._DataSource.UpdateRow(loUpdateInfo, loRow, New ConcurrencyExceptionHandler(AddressOf HandleConcurrencyException), New AddRowErrorHandler(AddressOf AddRowError))&lt;br&gt;
[/codesnippet]&lt;br&gt;
Please advice.&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Mon, 11 May 2009 13:39:06 GMT</pubDate><dc:creator>ChanKK</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23070.aspx</link><description>Chan,&lt;/P&gt;&lt;P&gt;I will post on the other thread also, but we found where we had made a change to improve transaction performance.&amp;nbsp; If you were NOT using SPROCS for your inserts and updates on a transaction, the error you are referring to would occur.&amp;nbsp; By default we do everything with SPROCS, but the ExecuteReader was being closed.&amp;nbsp; The build that has just been posted will fix the SqlTransaction issue you have been running into.</description><pubDate>Mon, 11 May 2009 13:39:06 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23031.aspx</link><description>[quote][b]Edhy Rijo (05/06/2009)[/b][hr][quote][b]ChanKK (05/06/2009)[/b][hr]Hi,&lt;br&gt;
It is at SqlDataSourceItem.UpdateRow().[/quote]&lt;br&gt;
ChanKK,&lt;br&gt;
I believe Trent is asking in which class/method/BO is the transactional code?&lt;br&gt;
[/quote]&lt;br&gt;
&lt;br&gt;
Hi,&lt;br&gt;
Sorry, I didn't get you.&lt;br&gt;
&lt;br&gt;
I have attached the sample project, this behavour can be "seen" when first BO.Save() is called.</description><pubDate>Wed, 06 May 2009 09:49:34 GMT</pubDate><dc:creator>ChanKK</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23030.aspx</link><description>[quote][b]ChanKK (05/06/2009)[/b][hr]Hi,&lt;br&gt;
It is at SqlDataSourceItem.UpdateRow().[/quote]&lt;br&gt;
ChanKK,&lt;br&gt;
I believe Trent is asking in which class/method/BO is the transactional code?&lt;br&gt;</description><pubDate>Wed, 06 May 2009 09:34:48 GMT</pubDate><dc:creator>Edhy Rijo</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23029.aspx</link><description>Hi,&lt;br&gt;
It is at SqlDataSourceItem.UpdateRow().</description><pubDate>Wed, 06 May 2009 09:30:27 GMT</pubDate><dc:creator>ChanKK</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23027.aspx</link><description>We set the connection object only on certain areas.&amp;nbsp; This is not one of them.&amp;nbsp; For example, when you call the FillDataTable method on a BO and pass a DbCommand object, we will set the Connection automatically.&amp;nbsp; However, this is the only type of scenario that we do this withing the framework.&lt;/P&gt;&lt;P&gt;Where is this code that you are showing screen shots of?</description><pubDate>Wed, 06 May 2009 08:32:47 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23021.aspx</link><description>Hi,&lt;br&gt;
I do further testing and found that, the transaction.connection goes null just after loReader.Close() is executed. I checked the code and found that SF use do the following in InternalExecuteReader(). Do you think it is the cause?&lt;br&gt;
&lt;br&gt;
[codesnippet]'-- Execute the command&lt;br&gt;
Return Command.ExecuteReader(CommandBehavior.CloseConnection)[/codesnippet]&lt;br&gt;
&lt;br&gt;
I attached screenshot to show Watch window shown Transaction.Connection has something, but goes null after Reader.Close().&lt;br&gt;
&lt;br&gt;
Hope my information helps and not confuse you.&lt;br&gt;
&lt;br&gt;
Thank you</description><pubDate>Tue, 05 May 2009 06:10:43 GMT</pubDate><dc:creator>ChanKK</dc:creator></item><item><title>RE: Failed to save</title><link>http://forum.strataframe.net/FindPost23020.aspx</link><description>Hi,&lt;br&gt;
I just come across this forum post, and it mentioned it is SqlTransaction.Connection property goes null randomly is actually ADO.NET bug. It provides workaround as well.&lt;br&gt;
&lt;br&gt;
I am not sure if this bug is still exist in ADO.NET as this post is dated year 2007.&lt;br&gt;
&lt;br&gt;
http://www.ormapper.net/Forums/Default.aspx?part=74&amp;action=thread&amp;id=2450&amp;key=IaC12zYu0ykFv3qP9v11Tg%3D%3D</description><pubDate>Tue, 05 May 2009 04:48:25 GMT</pubDate><dc:creator>ChanKK</dc:creator></item></channel></rss>