Hi All,I'm a new OutSystems developer and would appreciate your advice.I encountered the following error in an OutSystems Timer:Error:Error executing query.Error in advanced query SQL_...ORA-01013: user requested cancel of current operationEnvironment:- OutSystems + Oracle Database (19c)- The main source table had 0 records (this is a rare situation)- Other source tables contained records, but the volume was small- The execution time was shorter than usual- No manual Timer abort was performed- The Timer started at the scheduled timeThis Timer normally runs without issues. Since the main source table contained no records, I expected the query to return 0 rows and complete successfully.Although I understand that an empty result set itself should not cause ORA-01013, the fact that the main source table had 0 records is the only unusual condition compared to normal executions. Could this scenario be related in any way to the error?Has anyone experienced ORA-01013 under similar conditions?Are there any known causes in OutSystems or Oracle that could automatically cancel a query, such as:- Session termination- Query timeout- Network issues- Database maintenance- Resource Manager restrictions- Other Oracle-side settingsAny advice or troubleshooting suggestions would be greatly appreciated.Thanks in advance.Hu
You’re right that “0 rows” by itself shouldn’t cause ORA‑01013. That error almost always means “the server aborted the work” (usually due to timeout, connection drop, or session kill), not a logical problem with the query result.
Given your description and the forum cases you shared, here’s how I’d look at it from an OutSystems + Oracle 19c perspective.
Almost certainly only indirectly, if at all.
Oracle does not cancel a query because a table is empty. The query optimizer might even execute faster with an empty table. So:
Then the “0 rows” condition is likely a red herring. ORA‑01013 was more probably triggered by:
The examples you provided support this: ORA‑01013 is consistently reported as a timeout or blocking/locking symptom, not as a data-content symptom. ORA-01013: user requested cancel of current operation
Here are the most typical causes I’ve seen (and that appear in your referenced topics):
Execution timeout (application or infrastructure)
Database locking / transaction issues
Network / connection drops
Scheduler / timer infrastructure errors
Oracle Resource Manager / maintenance operations
Because you’re using an Advanced Query inside a Timer, I’d follow this checklist:
Go to Service Center → Monitoring → Timers and:
Check General Logs / Error Logs around that time:
Ask your DBA to check around the timestamp of the error:
alert.log
Also: see if Oracle’s v$session / v$session_event / dba_audit_trail captured your session being terminated.
v$session
v$session_event
dba_audit_trail
Even if the main table is empty, check for:
FOR UPDATE
You can get the SQL from the Advanced Query and ask the DBA to:
Verify if:
With your platform admin:
To narrow it down and avoid surprises:
Log more context in the Timer
Run a “no-op” version of the Timer
Chunk the work (if not already) Even if this specific run had fewer records:
Ensure proper commits
Could the empty main source table be related?
Not directly. Oracle will not cancel a query because the main table has 0 rows. The empty table likely just coincided with another issue (timeout, session kill, or network problem) that caused ORA‑01013.
Have others seen ORA‑01013 in similar conditions?
Yes. In OutSystems environments, ORA‑01013 is commonly reported when:
Are there known automatic causes (session termination, query timeout, etc.)?
Yes, all of these are plausible:
If you can share (internally) the approximate duration when it fails, timer timeout configuration, and confirmation from the DBA whether your session was killed, you’ll probably pinpoint whether this is a simple timeout, a locking issue, or a network/session closure.
What I would investigate first
1. Check whether OutSystems cancelled the database request
Look at the Timer execution details around the exact timestamp.
You want to establish:
Timer started↓Advanced SQL started↓ORA-01013↓Timer failed
Compare the timestamps with a successful execution.
If the SQL normally takes, for example:
Normal: 10 minutes Failure: 30 seconds
then a database query timeout becomes less likely.
If instead:
Normal: 10 minutes Failure: exactly 60 seconds
or:
exactly 5 minutes
then I would strongly investigate an application/infrastructure timeout.
Hello @Chen Hu According to Oracle, ORA-01013 ("user requested cancel of current operation") indicates that Oracle received a request to cancel a SQL operation while it was executing. Oracle treats this as an interruption rather than a SQL processing error.
For an OutSystems Timer, some common causes include:
Application-side query timeouts
The OutSystems platform, Oracle client, or middleware may cancel a query if it exceeds a configured timeout threshold.
Oracle drivers can return ORA-01013 when a command timeout occurs.
Session cancellation or termination
A DBA or an automated process may have cancelled or terminated the database session.
Regarding the scenario where the main source table contained 0 records, this condition alone would not normally cause ORA-01013. When the driving table is empty, Oracle typically returns an empty result set and completes the query successfully, often faster than usual.
My suggestion review OutSystems logs for:
Query timeout messages
Timer abort events
Connection-related errors
Database alert logs
Oracle Resource Manager configurations
Any session cancel or kill operations that occurred during the Timer execution window
On top of that Verify timeout configurations in:
OutSystems
Oracle client/provider settings
Application server settings
Conclusion
Based on the information provided, an empty source table by itself should not generate ORA-01013. The error typically indicates that the SQL execution was interrupted by a timeout, session cancellation, administrative action, network-related issue, or an Oracle resource-management policy rather than by the query returning no rows.
Hi @Chen HuORA-01013 means "user requested cancel" — but in practice it's almost never an actual user clicking cancel. It's Oracle's generic message for "something external killed this query before it finished." The empty main table isn't the cause — it's just a coincidence that happened on the same run.
Most likely causes, in order of probability:
Timer timeout (most common) — OutSystems Timers have a max execution time set in Service Center (Administration → Timers). If this run finished faster than usual but still got cancelled, check if the timeout is set too low and something (locking, connection pool) delayed the start internally.
Query/statement timeout at the DB or connection pool level — Check the CommandTimeout on the Oracle connection in Service Center, or any DB-side resource limits (Resource Manager, profile limits) that could kill long/idle queries.
Session killed externally — DBA scripts, Oracle jobs, or Resource Manager policies that kill sessions matching certain criteria (idle time, resource usage) can throw exactly this error even for short-running queries.
Connection pool recycling — if the app pool or DB connection got recycled/reset mid-query (deploy, restart, pool timeout), Oracle reports it the same way.
Network blip — a dropped connection between OutSystems and Oracle can also surface as ORA-01013.
What I'd check first:
Since it's intermittent and not tied to data volume, it's very unlikely to be a code issue — this is almost always infrastructure/environment level. If you can pull the exact timestamp and check the Oracle alert log for that minute, that'll usually tell you who killed the session.