<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Transactions in PHP"]]></title>
		<link>http://forums.visual-paradigm.com/posts/32.html</link>
		<description><![CDATA[Latest messages posted in the topic "Transactions in PHP"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Transactions in PHP</title>
				<description><![CDATA[ I know that EZPDO supports transactions, but when I try to use them I receive the following error:<br> <br>  <table class="code-table-simple" align="center">
		<tr> 
		<td><span class="genmed"><b>Code:</b></span></td>
		</tr>
		</table>
		<table class="code-table" align="center">
		<tr>
		<td class="code">
		<pre> 
 Exception
 Description
 
 Object Company does not contains variable
 Source File
 
 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObjectUtil.php &#40;227&#41;
 
 0216:             } else {
 0217:                 throw new Exception&#40;'Unable to get variable details of '.&#36;aVarName.' without variables'&#41;;
 0218:             }
 0219:         }
 0220:         &#36;lVarNameSearch = strtolower&#40;&#36;aVarName&#41;;
 0221:         foreach &#40;&#36;aVariables as &#36;lVarName =&gt; &#36;lDetails&#41; {
 0222:             &#36;lVarName = strtolower&#40;&#36;lVarName&#41;;
 0223:             if &#40;&#36;lVarNameSearch == &#36;lVarName&#41; {
 0224:                 return &#36;lDetails;
 0225:             }
 0226:         }
 0227: throw new Exception&#40;'Object '.get_class&#40;&#36;aObject&#41;.' does not contains variable '.&#36;aVarName&#41;;
 0228:     }
 0229: 
 0230:     protected function &getVariableName&#40;&&#36;aObject, &&#36;aVariables, &&#36;aVarName, &&#36;aAutoCreate = false&#41; {
 0231:         &#36;lDetails = &#36;this-&gt;getVariableDetails&#40;&#36;aObject, &#36;aVariables, &#36;aVarName, &#36;aAutoCreate&#41;;
 0232:         &#36;lVarName = &#36;lDetails&#91;'NAME'&#93;;
 0233:         if &#40;is_null&#40;&#36;lVarName&#41;&#41; {
 0234:             return &#36;aVarName;
 0235:         }
 0236:         return &#36;lVarName;
 0237:     }
 0238: 
 0239:     protected function debugVariable&#40;&&#36;aObject, &&#36;aVariables&#41; {
 
 
 Stack Trace
 
 #0 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObjectUtil.php&#40;174&#41;: epObjectUtil-&gt;getVariableDetails&#40;Object&#40;Company&#41;, Array, NULL, true&#41;
 #1 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#40;3036&#41;: epObjectUtil-&gt;getByGetter&#40;Object&#40;Company&#41;, Array, NULL, true&#41;
 #2 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#40;2998&#41;: epObject-&gt;_reduceRelationshipVar&#40;'user'&#41;
 #3 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#40;2866&#41;: epObject-&gt;_backupObjectVars&#40;&#41;
 #4 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epTransaction.php&#40;83&#41;: epObject-&gt;epStartTransaction&#40;&#41;
 #5 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epManager.php&#40;2099&#41;: epTransaction-&gt;addObject&#40;Object&#40;epObject&#41;, Object&#40;epDbObject&#41;&#41;
 #6 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epManager.php&#40;743&#41;: epManagerBase-&gt;addObject_t&#40;Object&#40;epObject&#41;&#41;
 #7 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/classes/CompanyFactory.php&#40;5&#41;: epManagerBase-&gt;create&#40;'Company'&#41;
 #8 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/Controllers/NewAccountController.php&#40;41&#41;: CompanyFactory::loadCompanyByORMID&#40;'PTS'&#41;
 #9 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/UI/Pages/CreateNewAccount.php&#40;36&#41;: NewAccountController-&gt;createAccount&#40;Object&#40;UserRegistrationDTO&#41;&#41;
 #10 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TComponent.php&#40;374&#41;: CreateNewAccount-&gt;onCompleteRegistration&#40;Object&#40;TWizard&#41;, Object&#40;TWizardNavigationEventParameter&#41;&#41;
 #11 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TWizard.php&#40;686&#41;: TComponent-&gt;raiseEvent&#40;'OnCompleteButto...', Object&#40;TWizard&#41;, Object&#40;TWizardNavigationEventParameter&#41;&#41;
 #12 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TWizard.php&#40;1388&#41;: TWizard-&gt;onCompleteButtonClick&#40;Object&#40;TWizardNavigationEventParameter&#41;&#41;
 #13 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TControl.php&#40;1430&#41;: TWizard-&gt;bubbleEvent&#40;Object&#40;TButton&#41;, Object&#40;TCommandEventParameter&#41;&#41;
 #14 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php&#40;205&#41;: TControl-&gt;raiseBubbleEvent&#40;Object&#40;TButton&#41;, Object&#40;TCommandEventParameter&#41;&#41;
 #15 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php&#40;222&#41;: TButton-&gt;onCommand&#40;Object&#40;TCommandEventParameter&#41;&#41;
 #16 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;909&#41;: TButton-&gt;raisePostBackEvent&#40;'undefined'&#41;
 #17 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;255&#41;: TPage-&gt;raisePostBackEvent&#40;&#41;
 #18 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;190&#41;: TPage-&gt;processPostBackRequest&#40;Object&#40;THtmlWriter&#41;&#41;
 #19 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php&#40;474&#41;: TPage-&gt;run&#40;Object&#40;THtmlWriter&#41;&#41;
 #20 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php&#40;420&#41;: TPageService-&gt;runPage&#40;Object&#40;CreateNewAccount&#41;, Array&#41;
 #21 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php&#40;1066&#41;: TPageService-&gt;run&#40;&#41;
 #22 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php&#40;376&#41;: TApplication-&gt;runService&#40;&#41;
 #23 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/index.php&#40;16&#41;: TApplication-&gt;run&#40;&#41;
 #24 {main}
 
 
  </pre></td>
		</tr>
		</table> <br> <br> My application code looks like this:<br> <br> <br>  <table class="code-table-simple" align="center">
		<tr> 
		<td><span class="genmed"><b>Code:</b></span></td>
		</tr>
		</table>
		<table class="code-table" align="center">
		<tr>
		<td class="code">
		<pre> 
 epManager::instance&#40;&#41;-&gt;start_t&#40;&#41;;
 		&#36;company = CompanyFactory::loadCompanyByORMID&#40;&#36;accountDto-&gt;companyName&#41;;
 		
 		if &#40; !is_null&#40;&#36;company&#41; &#41;
 			throw new DuplicateObjectException&#40;"Specified company already exists."&#41;;
 		
 		&#36;company = CompanyFactory::createCompany&#40;&#41;;
 			
 		&#36;user = new User&#40;&#41;;
 		&#36;user = UserFactory::createUser&#40;&#41;;
 		&#36;user-&gt;setLoginId&#40;&#36;accountDto-&gt;userName&#41;;
 		&#36;user-&gt;setEmail&#40;&#36;accountDto-&gt;emailAddress&#41;;
 		&#36;user-&gt;setLanguage&#40;&#36;accountDto-&gt;language&#41;;
 		&#36;user-&gt;setTimezone&#40;&#36;accountDto-&gt;timeZone&#41;;
 		&#36;user-&gt;setPassword&#40;&#36;accountDto-&gt;password&#41;;
 		
 		&#36;company-&gt;setName&#40;&#36;accountDto-&gt;companyName&#41;;
 		&#36;company-&gt;user&#91;&#93; = &#36;user;
 		&#36;company-&gt;save&#40;&#41;;
 		
 		try {
 			epManager::instance&#40;&#41;-&gt;commit_t&#40;false&#41;;
 		}
 		catch &#40;Exception &#36;e&#41;
 		{
 			throw new PersistenceLayerException&#40;"Could not store account details."&#41;;
 		}
  </pre></td>
		</tr>
		</table> <br> <br> If I comment out the transaction parts, everything works fine but with them I get the error above.  I tried upgrading the EZPDO library by hand but that introduced new issues.  Is there any way to get transaction support?  WIthout it I really can't use DB_VA for anything more important than a small personal project.]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20160.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20160.html</link>
				<pubDate><![CDATA[Wed, 14 Nov 2007 05:54:11]]></pubDate>
				<author><![CDATA[ rbegga]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Hi rbegga,<br> <br> Sorry about the problem. It has been fixed. Please download at:<br> <a href="http://files3.visual-paradigm.com/200711/Patch/sp1_20071119f/VP_Suite_Windows_3_1_sp1_20071119f.exe" target="_blank" rel="nofollow">http://files3.visual-paradigm.com/200711/Patch/sp1_20071119f/VP_Suite_Windows_3_1_sp1_20071119f.exe</a><br> <br> Please run it and overwrite the existing installation.<br> <br> Best regards,<br> Jick]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20198.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20198.html</link>
				<pubDate><![CDATA[Thu, 15 Nov 2007 19:16:00]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Jick,<br> <br> Thanks for your quick response, that was awesome!!!  The only issue is I forgot to mention that I am using the Mac version of DBVA.  Is there any way I can get a patch for the Mac?<br> <br> Thanks again for your help,<br> <br> -TJ]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20202.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20202.html</link>
				<pubDate><![CDATA[Fri, 16 Nov 2007 00:54:03]]></pubDate>
				<author><![CDATA[ rbegga]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Hi rbegga,<br> <br> Please try this:<br> <a href="http://files3.visual-paradigm.com/200711/Patch/sp1_20071119f/VP_Suite_MacOSX_3_1_sp1_20071119f.dmg" target="_blank" rel="nofollow">http://files3.visual-paradigm.com/200711/Patch/sp1_20071119f/VP_Suite_MacOSX_3_1_sp1_20071119f.dmg</a><br> <br> Best regards,<br> Jick<br> ]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20211.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20211.html</link>
				<pubDate><![CDATA[Fri, 16 Nov 2007 07:57:54]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Jick,<br> <br> The patch allowed me to call the EZPDO transaction functions, however when I try to rollback a transaction I get the following error:<br> <br>  <table class="code-table-simple" align="center">
		<tr> 
		<td><span class="genmed"><b>Code:</b></span></td>
		</tr>
		</table>
		<table class="code-table" align="center">
		<tr>
		<td class="code">
		<pre> TPhpErrorException
 Description
 
 &#91;Warning&#93; Invalid argument supplied for foreach&#40;&#41; &#40;@line 2977 in file /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#41;.
 Source File
 
 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php &#40;2977&#41;
 
 2966:         }
 2967:         return &#36;backup;
 2968:     }
 2969: 
 2970:     /**
 2971:      * Restore the wrapper vars
 2972:      * @param array &#36;backup
 2973:      * @return void
 2974:      */
 2975:     protected function _restoreWrapperVars&#40;&#36;backup&#41; {
 2976:         // set vars back to wrapper
 2977: foreach&#40;&#36;backup as &#36;var =&gt; &#36;value&#41; {
 2978:             &#36;this-&gt;&#36;var = &#36;value;
 2979:         }
 2980:     }
 2981: 
 2982:     /**
 2983:      * Backup the object vars
 2984:      * @return array 
 2985:      */
 2986:     protected function _backupObjectVars&#40;&#41; {
 2987:         &#36;backup = array&#40;&#41;;
 2988:         foreach&#40;&#36;this-&gt;ep_cached_vars as &#36;var =&gt; &#36;lDetails&#41; {
 2989:         // foreach&#40;&#36;this-&gt;ep_cached_vars as &#36;var&#41; {
 
 
 Stack Trace
 
 #0 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#40;2977&#41;: PradoBase::phpErrorHandler&#40;2, 'Invalid argumen...', '/Applications/x...', 2977, Array&#41;
 #1 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php&#40;2886&#41;: epObject-&gt;_restoreWrapperVars&#40;NULL&#41;
 #2 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epTransaction.php&#40;131&#41;: epObject-&gt;epEndTransaction&#40;true&#41;
 #3 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epManager.php&#40;2063&#41;: epTransaction-&gt;rollbackObjects&#40;&#41;
 #4 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/Controllers/NewAccountController.php&#40;81&#41;: epManagerBase-&gt;rollback_t&#40;&#41;
 #5 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/UI/Pages/CreateNewAccount.php&#40;75&#41;: NewAccountController-&gt;createAccount&#40;Object&#40;UserRegistrationDTO&#41;&#41;
 #6 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TComponent.php&#40;374&#41;: CreateNewAccount-&gt;onCompleteRegistration&#40;Object&#40;TButton&#41;, NULL&#41;
 #7 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php&#40;192&#41;: TComponent-&gt;raiseEvent&#40;'OnClick', Object&#40;TButton&#41;, NULL&#41;
 #8 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php&#40;221&#41;: TButton-&gt;onClick&#40;NULL&#41;
 #9 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;909&#41;: TButton-&gt;raisePostBackEvent&#40;'undefined'&#41;
 #10 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;255&#41;: TPage-&gt;raisePostBackEvent&#40;&#41;
 #11 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php&#40;190&#41;: TPage-&gt;processPostBackRequest&#40;Object&#40;THtmlWriter&#41;&#41;
 #12 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php&#40;474&#41;: TPage-&gt;run&#40;Object&#40;THtmlWriter&#41;&#41;
 #13 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php&#40;420&#41;: TPageService-&gt;runPage&#40;Object&#40;CreateNewAccount&#41;, Array&#41;
 #14 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php&#40;1066&#41;: TPageService-&gt;run&#40;&#41;
 #15 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php&#40;376&#41;: TApplication-&gt;runService&#40;&#41;
 #16 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/index.php&#40;16&#41;: TApplication-&gt;run&#40;&#41;
 #17 {main}
 
 2007-11-15 23:39 Apache/2.2.6 &#40;Unix&#41; mod_ssl/2.2.6 OpenSSL/0.9.8e DAV/2 PHP/5.2.4 PRADO/3.1.1
  </pre></td>
		</tr>
		</table> <br> <br> Not sure what the issue might be...]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20218.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20218.html</link>
				<pubDate><![CDATA[Fri, 16 Nov 2007 12:40:31]]></pubDate>
				<author><![CDATA[ rbegga]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Hi rbegga,<br> <br> We are unable to repeat your problem. Please provide us with more detail. E.g.:<br> - Generated *.php<br> - .vpp file<br> - Other .php files related to the problem.<br> <br> Best regards,<br> Jick<br> ]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20242.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20242.html</link>
				<pubDate><![CDATA[Mon, 19 Nov 2007 13:50:02]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Jick,<br> <br> I think the error message itself might have been something on my end, however it seems like transactions still aren't working like they should.  I have attached a complete example .VPP file as well as my own CreateData demo php file.  <br> <br> Basically the issue is that if you run the CreateJobinizerData.php file once, the records are created properly for the test data objects.  The second time you run it, an exception occurs because you are inserting duplicate data in the database, which is correct.  The problem is the state of the database after the exception:  records for the objects that had no exception while saving are still being created, which is incorrect because if any part of the transaction fails, then entire thing should be rolled back, and it doesn't seem to be doing that for me.]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20256.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20256.html</link>
				<pubDate><![CDATA[Tue, 20 Nov 2007 06:09:49]]></pubDate>
				<author><![CDATA[ rbegga]]></author>
			</item>
			<item>
				<title>Re:Transactions in PHP</title>
				<description><![CDATA[ Hi rbegga,<br> <br> Thank you for the files. We'll check the problems and come back to you as soon as we can.<br> <br> Best regards,<br> Jick<br> ]]></description>
				<guid isPermaLink="true">http://forums.visual-paradigm.com/posts/2652#20277.html</guid>
				<link>http://forums.visual-paradigm.com/posts/2652#20277.html</link>
				<pubDate><![CDATA[Wed, 21 Nov 2007 18:19:34]]></pubDate>
				<author><![CDATA[ Jick]]></author>
			</item>
	</channel>
</rss>