sgpatil / oriquent

Orientdb Eloquent driver for Laravel 5
MIT License
47 stars 15 forks source link

Rollback can not work. #28

Open nambhd opened 8 years ago

nambhd commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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

nambhd commented 8 years ago

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 commented 8 years ago

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.