General error: 20018 SQL Anywhere Error -267: COMMIT/ROLLBACK not allowed within atomic operation
Closed this issue · 0 comments
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
- Laravel Framework 7.30.0
- PHP 7.4.10
- Composer version 2.0.4 2020-10-30 22:39:11
- uepg/laravel-sybase: 2.4.0
- SQL Anywhere v16
Additional context
Add any other context about the problem here. If no have additional information, delete the section Additional information
.