Using SELECT .. FOR UPDATE in SQL Query/Command service (postgresql)
I have a service in ThingWorx 9.0.1 that is selecting a row for update to avoid concurrent updates. The service works (in that it updates the tables correctly) but it always throws an exception. The code:
begin;
select * from opportunity where opportunity_number = 2 for update;
update opportunity set description = 'testing 1.2.3.4.5..' where opportunity_number = 2;
commit;
I've tried several ways to eliminate the error (changing the result type, changing from query to command, etc..) I always get one of these errors:
--When I'm using the Query handler:
Unable to Invoke Service test on Thing.DB.Forecasting : Execute Query failed: org.postgresql.util.PSQLException: No results were returned by the query.
OR
--When I'm using the Command handler:
Unable to Invoke Service test on Thing.DB.Forecasting : Execute Update failed: org.postgresql.util.PSQLException: A result was returned when none was expected.
Like I said before, the service does work, but I'd like to get rid of that exception if possible.

