Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollback can not work. #28

Open
nambhd opened this issue Jun 29, 2016 · 5 comments
Open

Rollback can not work. #28

nambhd opened this issue Jun 29, 2016 · 5 comments

Comments

@nambhd
Copy link
Contributor

nambhd commented Jun 29, 2016

Hi,
Here is my source code:

DB::beginTransaction();

            try {
                // Create new company
                $companyData['subdomain']   = $data['subdomain'];
                $companyData['status']      = Company::STATUS_REGISTERED;

               Company::create($companyData);
            } catch(\Exception $e)
            {
                DB::rollback();
                throw $e;
            }

            try {
                // Create default employee template
                $templateData['title']          = 'Basic info';
                $templateData['position']       = 0;
                $templateData['protected_flag'] = 1;
                $templateData['fields']         = null;
                Template::create($templateData);
            } catch(\Exception $e)
            {
                DB::rollback();
                throw $e;
            }

           // DB::commit();
           DB::rollback();

But rollback() function seem not work, please help me to solve it.

@nambhd
Copy link
Contributor Author

nambhd commented Jun 29, 2016

I received error:

Class Sgpatil\Orientphp\Command\RollbackTransaction contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Sgpatil\Orientphp\Command::getCommand)

Please help me soon!

@sgpatil
Copy link
Owner

sgpatil commented Jun 29, 2016

Hello @lequocnam , Trying to resolve it soon, but want to know are you using this for production purpose because the project is not stable yet to use in live projects.

@nambhd
Copy link
Contributor Author

nambhd commented Jun 29, 2016

I'm using Oriquent version v5.2.0.1 with laravel 5.2.*

@nambhd
Copy link
Contributor Author

nambhd commented Jun 30, 2016

I know, I'm trying to see if it is working well or not for the functionality that I need.
Could you tell me this function (DB transaction) is possible to fix. And It can be completed soon okay?

@sgpatil
Copy link
Owner

sgpatil commented Jun 30, 2016

Hello @lequocnam, sorry to say but it will take some time as at present I am focusing on building relationship part, meanwhile you can contribute to code as making PR are always welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants