uepg / laravel-sybase

Connection and Laravel Eloquent driver for Sybase
GNU General Public License v2.0
33 stars 16 forks source link

General error: 20018 SQL Anywhere Error -267: COMMIT/ROLLBACK not allowed within atomic operation #72

Closed AlunR closed 1 year ago

AlunR commented 3 years ago

Describe the bug

When making a CALL to the SQLAnywhere DB call mydatabase.ABCfunction(iforenames='Alun',isurname='Rowe',iemailaddress='alun@example.com',isite='ABC1231DDFFEERR') I am receiving the following error:

General error: 20018 SQL Anywhere Error -267: COMMIT/ROLLBACK not allowed within atomic operation

Select statements against the same database work fine as do read only calls.

To Reproduce

Steps to reproduce the behavior:

config/database.php

        'spaceman' => [
            'driver' => 'sqlsrv',
            'host' => env('DB_SM_HOST', 'localhost'),
            'port' => env('DB_SM_PORT', ''),
            'database' => env('DB_SM_DATABASE', ''),
            'username' => env('DB_SM_USERNAME', ''),
            'password' => env('DB_SM_PASSWORD', ''),
            'charset' => 'utf8',
            'prefix' => '',
        ],

.env

DB_SM_HOST=192.168.9.76
DB_SM_PORT=2646
DB_SM_DATABASE=mydatabase
DB_SM_USERNAME=user
DB_SM_PASSWORD=password

app\services\MyLibrary.php

$results = DB::connection('spaceman')->statement($querystring);

Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 20018 SQL Anywhere Error -267: COMMIT/ROLLBACK not allowed within atomic operation [20018] (severity 16) [call mydatabase.ABCfunction(iforenames='Alun',isurname='Schtoop',iemailaddress='alun@example.com',isite='ABC1231DDFFEERR')] (SQL: call mydatabase.ABCfunction(iforenames='Alun',isurname='Schtoop',iemailaddress='alun@example.com',isite='ABC1231DDFFEERR'))

Expected behavior

return a single result with the id of the updated record

Please note using the SQLAnywhere PHP client library we get this no problem (but it is locked to PHP 7.1)

Versions

Additional context

Add any other context about the problem here. If no have additional information, delete the section Additional information.