I know that EZPDO supports transactions, but when I try to use them I receive the following error:
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 (227)
0216: } else {
0217: throw new Exception('Unable to get variable details of '.$aVarName.' without variables');
0218: }
0219: }
0220: $lVarNameSearch = strtolower($aVarName);
0221: foreach ($aVariables as $lVarName => $lDetails) {
0222: $lVarName = strtolower($lVarName);
0223: if ($lVarNameSearch == $lVarName) {
0224: return $lDetails;
0225: }
0226: }
0227: throw new Exception('Object '.get_class($aObject).' does not contains variable '.$aVarName);
0228: }
0229:
0230: protected function &getVariableName(&$aObject, &$aVariables, &$aVarName, &$aAutoCreate = false) {
0231: $lDetails = $this->getVariableDetails($aObject, $aVariables, $aVarName, $aAutoCreate);
0232: $lVarName = $lDetails['NAME'];
0233: if (is_null($lVarName)) {
0234: return $aVarName;
0235: }
0236: return $lVarName;
0237: }
0238:
0239: protected function debugVariable(&$aObject, &$aVariables) {
Stack Trace
#0 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObjectUtil.php(174): epObjectUtil->getVariableDetails(Object(Company), Array, NULL, true)
#1 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php(3036): epObjectUtil->getByGetter(Object(Company), Array, NULL, true)
#2 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php(2998): epObject->_reduceRelationshipVar('user')
#3 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epObject.php(2866): epObject->_backupObjectVars()
#4 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epTransaction.php(83): epObject->epStartTransaction()
#5 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epManager.php(2099): epTransaction->addObject(Object(epObject), Object(epDbObject))
#6 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/lib/phporm/src/runtime/epManager.php(743): epManagerBase->addObject_t(Object(epObject))
#7 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/ORM/classes/CompanyFactory.php(5): epManagerBase->create('Company')
#8 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/Core/Controllers/NewAccountController.php(41): CompanyFactory::loadCompanyByORMID('PTS')
#9 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/protected/UI/Pages/CreateNewAccount.php(36): NewAccountController->createAccount(Object(UserRegistrationDTO))
#10 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TComponent.php(374): CreateNewAccount->onCompleteRegistration(Object(TWizard), Object(TWizardNavigationEventParameter))
#11 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TWizard.php(686): TComponent->raiseEvent('OnCompleteButto...', Object(TWizard), Object(TWizardNavigationEventParameter))
#12 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TWizard.php(1388): TWizard->onCompleteButtonClick(Object(TWizardNavigationEventParameter))
#13 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TControl.php(1430): TWizard->bubbleEvent(Object(TButton), Object(TCommandEventParameter))
#14 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php(205): TControl->raiseBubbleEvent(Object(TButton), Object(TCommandEventParameter))
#15 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/WebControls/TButton.php(222): TButton->onCommand(Object(TCommandEventParameter))
#16 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php(909): TButton->raisePostBackEvent('undefined')
#17 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php(255): TPage->raisePostBackEvent()
#18 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/UI/TPage.php(190): TPage->processPostBackRequest(Object(THtmlWriter))
#19 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php(474): TPage->run(Object(THtmlWriter))
#20 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/Web/Services/TPageService.php(420): TPageService->runPage(Object(CreateNewAccount), Array)
#21 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php(1066): TPageService->run()
#22 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/framework/TApplication.php(376): TApplication->runService()
#23 /Applications/xampp/xamppfiles/htdocs/jobinizer/trunk/app/index.php(16): TApplication->run()
#24 {main}
My application code looks like this:
epManager::instance()->start_t();
$company = CompanyFactory::loadCompanyByORMID($accountDto->companyName);
if ( !is_null($company) )
throw new DuplicateObjectException("Specified company already exists.");
$company = CompanyFactory::createCompany();
$user = new User();
$user = UserFactory::createUser();
$user->setLoginId($accountDto->userName);
$user->setEmail($accountDto->emailAddress);
$user->setLanguage($accountDto->language);
$user->setTimezone($accountDto->timeZone);
$user->setPassword($accountDto->password);
$company->setName($accountDto->companyName);
$company->user[] = $user;
$company->save();
try {
epManager::instance()->commit_t(false);
}
catch (Exception $e)
{
throw new PersistenceLayerException("Could not store account details.");
}
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.