<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — cancel_transaction (not really a bug)]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7402&amp;type=atom" />
	<updated>2018-03-16T21:04:44Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7402</id>
		<entry>
			<title type="html"><![CDATA[Re: cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31142#p31142" />
			<content type="html"><![CDATA[<p>I think it is for puritanism only. The reset should be sufficient for now. If any third-party careless code called it, possibly it might go into negative.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-03-16T21:04:44Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31142#p31142</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31140#p31140" />
			<content type="html"><![CDATA[<p>I have never heard of any problems here before. Please be a little more specific. If this is an error the test is very hard to setup, so please be sure that you have observed a problem.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2018-03-16T17:42:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31140#p31140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31138#p31138" />
			<content type="html"><![CDATA[<p>The <strong>cancel_transaction()</strong> resets the value of the <strong>$transaction_level</strong> to <strong>0</strong> whenever a script is called in FA, and it happens when the DB connection is setup each time in <strong>includes/db/connect_db_mysqli.inc</strong>.</p><p>@joe: any fixes here?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-03-16T16:08:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31138#p31138</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31137#p31137" />
			<content type="html"><![CDATA[<p>Yes, I was referring to sql_functions.inc. The commit_transaction() could cause the transaction level to go negative, which would nullify all following transactions. I was just thinking that commit transaction should test transaction level for &gt; 0 before decrementing the value.</p>]]></content>
			<author>
				<name><![CDATA[oakstreet1]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42263</uri>
			</author>
			<updated>2018-03-16T15:59:27Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31137#p31137</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31124#p31124" />
			<content type="html"><![CDATA[<p>There are no BEGIN ... COMMIT raw blocks in FA core codebase and possibly not even in any official Extension.</p><p>However, local SQL wrapper functions <strong>begin_transaction()</strong> and <strong>commit_transaction()</strong> exist and have such a check for non negative values as defined in <strong>includes/db/sql_functions.inc</strong>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2018-03-16T03:51:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31124#p31124</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[cancel_transaction (not really a bug)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=31123#p31123" />
			<content type="html"><![CDATA[<p>I&#039;m just familiarizing myself with the code before I get started on a rather major extension ...</p><p>In /includes/db/sql_functions.inc, there is a function called &quot;cancel_transaction&quot;. I&#039;m not sure if or when that is called, but if it were called inside of nested calls to begin/commit transaction calls and any function called &quot;commit&quot;, the global $transaction_level would go to -1, which would cause all following begin/commit calls to be ignored.</p><p>I could be missing something, and maybe the cancel is never called, but I can imagine some additional checks to be sure that $transaction_level never goes negative. I&#039;m not here to criticize something I don&#039;t completely understand. I just thought someone might want to consider this as a source of some unpredictable behavior, as, once the global was out of range, all subsequent &quot;transactions&quot; would actually not be done as transactions.</p>]]></content>
			<author>
				<name><![CDATA[oakstreet1]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=42263</uri>
			</author>
			<updated>2018-03-15T21:20:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=31123#p31123</id>
		</entry>
</feed>
