Opened 6 months ago

Closed 6 months ago

#1519 closed defect (fixed)

Petascope_Rollback transaction when SQL query failed

Reported by: bphamhuu Owned by: bphamhuu
Priority: major Milestone: 9.4
Component: petascope Version: development
Keywords: Cc: vmerticariu, dmisev
Complexity: Medium


The problem comes from #1518 and in DbMetadataSource? class line 1786 when the invalid SQL query are executed, it cannot roll back the transaction

SELECT id,label FROM ps_quantity WHERE uom_id='1' AND description=''{grib:marsClass}'' AND nil_ids='{13}'

ERROR:  syntax error at or near "{"
LINE 1: ...OM ps_quantity WHERE uom_id='1' AND description=''{grib:mars...

After the failing query, all other SQL query to petascopedb died due to the blocked transaction.

Caused by: org.postgresql.util.PSQLException: 
ERROR: current transaction is aborted, commands ignored until end of transaction block

it seems like the error is because it only close the transaction when it succeeds in DbMetadaSource? line 1546.

It should be check all the catch SQL Exception will need to be used with transaction abort.

Change History (1)

comment:1 Changed 6 months ago by bphamhuu

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.