<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hossam Assadallah</title>
    <description>The latest articles on DEV Community by Hossam Assadallah (@hossam_assadallah_842151a).</description>
    <link>https://dev.to/hossam_assadallah_842151a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4122391%2Fc124246e-8782-4686-9e5a-f06143cca7f7.jpeg</url>
      <title>DEV Community: Hossam Assadallah</title>
      <link>https://dev.to/hossam_assadallah_842151a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hossam_assadallah_842151a"/>
    <language>en</language>
    <item>
      <title>Oracle 19c Administration: What 20 Years in Production Taught Me</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Tue, 10 Nov 2026 16:18:07 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/oracle-19c-administration-what-20-years-in-production-taught-me-2a5g</link>
      <guid>https://dev.to/hossam_assadallah_842151a/oracle-19c-administration-what-20-years-in-production-taught-me-2a5g</guid>
      <description>&lt;p&gt;Most Oracle outages I have been called into were not caused by a missing feature or an exotic bug. They came from something nobody was looking at: a tablespace at 99%, a backup that had never been restored, one session holding a lock for forty minutes while a POS chain queued behind it.&lt;br&gt;
I have run Oracle in production for over 20 years, mostly behind ERP and POS systems where a slow query means a cashier waiting with a customer in front of them. This article is the practical core of what I check, in the order I check it, on Oracle 19c. Every query here runs as-is; adjust the thresholds to your system.&lt;br&gt;
One rule runs through all of it: measure before you change anything. Oracle tells you exactly where time is going. Most tuning mistakes come from guessing instead of asking.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start with waits, not guesses
When someone says "the database is slow", the first question is: slow doing what? Every active session in Oracle is either on CPU or waiting on something specific, and the wait event names it.
This is the first query I run during an incident:
SELECT s.sid,
   s.serial#,
   s.username,
   s.sql_id,
   s.event,
   s.wait_class,
   s.state,
   ROUND(s.wait_time_micro / 1e6, 1) AS wait_sec,
   s.blocking_session
FROM   v$session s
WHERE  s.status = 'ACTIVE'
AND    s.type = 'USER'
AND    s.wait_class &amp;lt;&amp;gt; 'Idle'
ORDER  BY s.wait_time_micro DESC;
Read the event column before anything else:
• db file sequential read: single-block reads, usually index access. Many of these from one sql_id often means a bad index path or a nested loop over too many rows.
• db file scattered read / direct path read: full scans. Fine for reports, suspicious in OLTP.
• enq: TX - row lock contention: someone is holding a row lock. Go to section 5.
• log file sync: commits waiting on redo writes. Too-frequent commits, or slow redo storage.
• library cache: mutex X / cursor: pin S wait on X: parsing pressure. Go to section 3.
For what happened ten minutes ago rather than right now, use Active Session History. It samples active sessions every second:
SELECT sql_id,
   event,
   COUNT(*) AS samples   -- roughly seconds of DB time
FROM   v$active_session_history
WHERE  sample_time &amp;gt; SYSDATE - INTERVAL '15' MINUTE
GROUP  BY sql_id, event
ORDER  BY samples DESC
FETCH FIRST 10 ROWS ONLY;
For trends across hours or days, generate an AWR report with @?/rdbms/admin/awrrpt.sql and start at the Top Timed Events and SQL ordered by Elapsed Time sections.
Licensing note: ASH and AWR are part of the Diagnostics Pack, an extra-cost option on Enterprise Edition. If you are not licensed, set control_management_pack_access = NONE and use Statspack (@?/rdbms/admin/spcreate.sql) instead. V$SESSION is free to query on every edition.&lt;/li&gt;
&lt;li&gt;Read the plan Oracle actually ran
EXPLAIN PLAN shows what the optimizer would do, with estimated row counts. It can differ from what really ran, especially with bind variables. When a query is slow, I want the real plan with real row counts.
Run the statement once with the gather_plan_statistics hint:
SELECT /*+ gather_plan_statistics */ i.item_code, SUM(l.qty)
FROM   sales_lines l
JOIN   items i ON i.item_id = l.item_id
WHERE  l.branch_id = :branch
AND    l.sale_date &amp;gt;= TRUNC(SYSDATE) - 7
GROUP  BY i.item_code;
Then, in the same session:
SELECT *
FROM   TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL, NULL, 'ALLSTATS LAST'));
For a statement already in the shared pool that you found in section 1, pass its sql_id instead of NULL.
The most useful thing in that output is the gap between E-Rows (estimated) and A-Rows (actual) on each line. When the optimizer expects 10 rows and gets 400,000, every decision above that line was built on a wrong number: the join method, the join order, the index choice. Find the first line, reading from the most indented, where the two diverge by an order of magnitude. That is where the real problem lives, and it is usually stale or missing statistics, a skewed column without a histogram, or a function wrapped around an indexed column.
That last one is the most common mistake I see from developers:
-- index on sale_date cannot be used
WHERE TRUNC(sale_date) = TRUNC(SYSDATE)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-- index on sale_date can be used&lt;br&gt;
WHERE sale_date &amp;gt;= TRUNC(SYSDATE)&lt;br&gt;
AND   sale_date &amp;lt;  TRUNC(SYSDATE) + 1&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Bind variables are not optional
Every distinct SQL text gets hard-parsed: Oracle checks syntax, permissions, and builds a plan, while holding latches and mutexes in the shared pool. A query built by string concatenation produces a new SQL text for every value, so ten thousand POS terminals asking for ten thousand different invoice numbers means ten thousand hard parses.
This finds statements that differ only in their literals:
SELECT force_matching_signature,
   COUNT(&lt;em&gt;)            AS versions,
   MIN(sql_id)         AS sample_sql_id,
   MIN(SUBSTR(sql_text, 1, 80)) AS sample_text
FROM   v$sql
WHERE  force_matching_signature &amp;lt;&amp;gt; 0
GROUP  BY force_matching_signature
HAVING COUNT(&lt;/em&gt;) &amp;gt; 50
ORDER  BY versions DESC;
If the top row shows hundreds of versions of the same query, you have found your shared pool problem.
The fix belongs in the application:
// node-oracledb: one SQL text, reused for every invoice
const result = await conn.execute(
&lt;code&gt;SELECT total FROM invoices WHERE invoice_no = :inv&lt;/code&gt;,
{ inv: invoiceNo }
);
Static SQL inside PL/SQL binds its variables automatically, which is one more reason to keep data logic in packages. Dynamic SQL does not: use EXECUTE IMMEDIATE ... USING, never || with a value.
cursor_sharing = FORCE replaces literals with system binds and can stop the bleeding during an incident. Treat it as a tourniquet, not a fix: it can hide skew from the optimizer and it does nothing for SQL injection.&lt;/li&gt;
&lt;li&gt;Statistics: the optimizer is only as good as what it knows
Oracle 19c gathers statistics automatically in the nightly maintenance window. That covers most tables most of the time. It fails in three predictable cases: a table loaded heavily during the day, a table truncated and reloaded by a batch job, and a window that gets skipped because the database was busy or down.
Find tables Oracle itself considers stale:
SELECT owner, table_name, num_rows, last_analyzed
FROM   dba_tab_statistics
WHERE  stale_stats = 'YES'
AND    owner NOT IN ('SYS', 'SYSTEM')
ORDER  BY last_analyzed NULLS FIRST;
Check that the automatic job is actually running:
SELECT client_name, status
FROM   dba_autotask_client
WHERE  client_name = 'auto optimizer stats collection';
When a batch job loads a large volume, gather right after the load, inside the job, instead of waiting for tonight:
BEGIN
DBMS_STATS.GATHER_TABLE_STATS(
ownname =&amp;gt; 'POS',
tabname =&amp;gt; 'SALES_LINES',
cascade =&amp;gt; TRUE   -- indexes too
);
END;
/
For staging tables that swing between empty and millions of rows, gather once at a representative size and lock them with DBMS_STATS.LOCK_TABLE_STATS. Otherwise the nightly job may capture them empty, and tomorrow's plans will assume zero rows.&lt;/li&gt;
&lt;li&gt;Locks: find the head of the chain
When sessions pile up on enq: TX - row lock contention, the waiting sessions are not the problem. The one holding the lock is. Often it is not even running anything.
This shows who is blocking whom, as a tree:
SELECT LPAD(' ', 2 * (LEVEL - 1)) || s.sid AS sid_tree,
   s.serial#,
   s.username,
   s.status,
   s.event,
   s.sql_id,
   s.prev_sql_id,
   s.machine,
   s.program
FROM   v$session s
WHERE  s.sid IN (SELECT blocking_session FROM v$session WHERE blocking_session IS NOT NULL)
OR  s.blocking_session IS NOT NULL
START  WITH s.blocking_session IS NULL
CONNECT BY PRIOR s.sid = s.blocking_session;
The root of the tree is your blocker. If its status is INACTIVE, you are looking at the most common lock incident in business applications: a session that updated a row and never committed. A form left open, an exception handler that swallowed the error without a rollback, a connection pool that handed back a connection mid-transaction. prev_sql_id shows the last statement it ran, which usually points straight at the code.
To see how long that transaction has been open:
SELECT s.sid, s.username, t.start_time, t.used_urec AS undo_records
FROM   v$session s
JOIN   v$transaction t ON t.addr = s.taddr
ORDER  BY t.start_time;
Killing the session is sometimes the right call: ALTER SYSTEM KILL SESSION 'sid,serial#' IMMEDIATE;. Know what it costs first. Oracle has to roll back everything that session did, and undo_records gives you a sense of how long that will take. Then fix the code path, or it will happen again next week.&lt;/li&gt;
&lt;li&gt;Space: the outage you can see coming
Running out of space is the most avoidable outage there is, and still one of the most common. Two places matter most.
Tablespaces. Don't calculate free space from dba_free_space alone; it ignores autoextend. This view accounts for it, measuring usage against the maximum each tablespace can grow to:
SELECT m.tablespace_name,
   ROUND(m.used_space      * t.block_size / 1024 / 1024 / 1024, 1) AS used_gb,
   ROUND(m.tablespace_size * t.block_size / 1024 / 1024 / 1024, 1) AS max_gb,
   ROUND(m.used_percent, 1) AS used_pct
FROM   dba_tablespace_usage_metrics m
JOIN   dba_tablespaces t ON t.tablespace_name = m.tablespace_name
ORDER  BY m.used_percent DESC;
Also check that the filesystem or ASM disk group underneath actually has that much room. A datafile set to autoextend to 32 GB on a disk with 4 GB free is a promise nobody can keep.
The Fast Recovery Area. In ARCHIVELOG mode, if the FRA fills up and the archiver cannot write, the database stops accepting changes and clients get ORA-00257. This is how a quiet weekend turns into a phone call.
SELECT file_type, percent_space_used, percent_space_reclaimable
FROM   v$recovery_area_usage
ORDER  BY percent_space_used DESC;
If archived logs dominate and little is reclaimable, your backups are not running or not deleting what they have already backed up. Section 8 covers that.&lt;/li&gt;
&lt;li&gt;Undo and ORA-01555
ORA-01555: snapshot too old means a query needed an older version of a block to stay read-consistent, and the undo holding that version had already been overwritten. The month-end report that runs for two hours is the usual victim.
V$UNDOSTAT keeps ten-minute buckets of undo activity and tells you whether your undo is keeping up:
SELECT begin_time,
   maxquerylen         AS longest_query_sec,
   tuned_undoretention AS retention_sec,
   ssolderrcnt         AS ora_1555_count,
   nospaceerrcnt
FROM   v$undostat
ORDER  BY begin_time DESC
FETCH FIRST 24 ROWS ONLY;
If longest_query_sec regularly exceeds retention_sec, the undo tablespace is too small for your workload. Grow it, or let its datafiles autoextend so Oracle can tune retention upward.
There is also a self-inflicted version, and I still find it in code reviews: opening a cursor over a big table, then updating and committing inside the loop that fetches from it. Each commit frees undo that the open cursor still needs, so the loop eventually reads a block it can no longer reconstruct. Committing every N rows feels safe. In this pattern it is what causes the error. Use a set-based UPDATE, or BULK COLLECT ... LIMIT with FORALL, and commit at the end of the logical unit of work.&lt;/li&gt;
&lt;li&gt;Backups: a backup you have never restored is a hope
I have met more than one team with nightly backups that turned out to be unusable on the day they needed them. The backup ran. Nobody had ever tried to bring it back.
A baseline RMAN setup for a single-instance 19c database:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-- the nightly job&lt;br&gt;
BACKUP DATABASE PLUS ARCHIVELOG;&lt;br&gt;
DELETE NOPROMPT OBSOLETE;&lt;br&gt;
The deletion policy plus DELETE OBSOLETE is what keeps the FRA from filling up in section 6. Copy backups off the database server too; a backup on the same disk as the database protects you from a dropped table, not from a dead server.&lt;br&gt;
Confirm the jobs actually succeeded, from SQL, without opening logs:&lt;br&gt;
SELECT start_time, end_time, input_type, status,&lt;br&gt;
       ROUND(output_bytes / 1024 / 1024 / 1024, 1) AS output_gb&lt;br&gt;
FROM   v$rman_backup_job_details&lt;br&gt;
ORDER  BY start_time DESC&lt;br&gt;
FETCH FIRST 14 ROWS ONLY;&lt;br&gt;
Then prove you can restore, at two levels:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Weekly, cheap: RESTORE DATABASE VALIDATE; reads every backup piece RMAN would need and checks it for corruption, without writing anything.&lt;/li&gt;
&lt;li&gt;Quarterly, real: restore onto a separate server, open the database, and run a query your business cares about, like yesterday's sales total. Time it. That number is your actual recovery time, and it is usually longer than anyone assumed.&lt;/li&gt;
&lt;li&gt;The five-minute morning check
None of this helps if you only look during an incident. This is the list I run every morning, ideally as a scheduled job that emails only when something crosses a line.
Check
Where
Act when
Last night's backup
v$rman_backup_job_details
Status is not COMPLETED
Tablespace usage
dba_tablespace_usage_metrics
Any tablespace above 85%
FRA usage
v$recovery_area_usage
Above 80% and little reclaimable
New errors
alert log (query below)
Any ORA- since yesterday
Long-open transactions
v$transaction
Open longer than 30 minutes
Stale statistics
dba_tab_statistics
Hot tables marked stale
Undo pressure
v$undostat
ssolderrcnt above 0
The alert log is queryable from SQL in 19c, so you do not need a shell on the server to read it:
SELECT originating_timestamp, message_text
FROM   v$diag_alert_ext
WHERE  originating_timestamp &amp;gt; SYSTIMESTAMP - INTERVAL '1' DAY
AND    message_text LIKE '%ORA-%'
ORDER  BY originating_timestamp DESC;
The database rarely fails without warning. It usually tells you days ahead, in a view nobody was querying. Most of administration is building the habit of asking.
What is on your morning checklist that is not on mine? I would like to hear what has saved you, especially from people running Oracle behind ERP and POS systems.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>gooshylx</category>
      <category>programming</category>
      <category>oracle</category>
    </item>
    <item>
      <title>MAX()+1: The Invoice Number That Showed Up Twice</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Sat, 03 Oct 2026 12:48:22 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/max1-the-invoice-number-that-showed-up-twice-3lb1</link>
      <guid>https://dev.to/hossam_assadallah_842151a/max1-the-invoice-number-that-showed-up-twice-3lb1</guid>
      <description>&lt;p&gt;3 Oct 2026 · &lt;a class="mentioned-user" href="https://dev.to/hossam"&gt;@hossam&lt;/a&gt; Assadallah&lt;br&gt;
Two invoices, one number&lt;br&gt;
Friday, 2 PM, and the restaurant is packed. Two cashiers hit "Save" at almost the same moment. Both get invoice number 10452.&lt;br&gt;
At month end, the accountant finds the duplicate. One of the two invoices drops out of the report; the other stays. The money gets counted once instead of twice.&lt;br&gt;
The system had run for years without a problem. The bug wasn't new. It was one line written on day one.&lt;br&gt;
The suspect&lt;br&gt;
Most of us have written this, or inherited it in someone else's code:&lt;br&gt;
SELECT NVL(MAX(invoice_no), 0) + 1&lt;br&gt;
  INTO v_new_no&lt;br&gt;
  FROM invoices;&lt;/p&gt;

&lt;p&gt;INSERT INTO invoices (invoice_no, ...)&lt;br&gt;
VALUES (v_new_no, ...);&lt;br&gt;
It looks perfectly reasonable: take the highest number and add one. With one user on one machine, it will work forever. It only breaks when several people write at once, which is exactly when the system matters most.&lt;br&gt;
What actually happened&lt;br&gt;
Oracle gives every session a consistent view of the data (read consistency). A session can't see rows another session inserted but hasn't committed yet.&lt;br&gt;
Time&lt;br&gt;
Cashier 1&lt;br&gt;
Cashier 2&lt;br&gt;
14:00:00.100&lt;br&gt;
MAX = 10451 → computes 10452&lt;/p&gt;

&lt;p&gt;14:00:00.120&lt;/p&gt;

&lt;p&gt;MAX = 10451 → computes 10452&lt;br&gt;
14:00:00.150&lt;br&gt;
INSERT 10452&lt;/p&gt;

&lt;p&gt;14:00:00.170&lt;/p&gt;

&lt;p&gt;INSERT 10452&lt;br&gt;
14:00:00.200&lt;br&gt;
COMMIT&lt;br&gt;
COMMIT&lt;br&gt;
Both sessions read the same truth at the same moment, and both were right from where they stood. The flaw is that "read, then write" is two separate steps, and anything can happen in the gap between them.&lt;br&gt;
The more users you add, the more often that gap gets hit.&lt;br&gt;
The usual patches&lt;br&gt;
When the bug surfaces, the first reaction is usually one of these:&lt;br&gt;
• A unique constraint on the column. It stops the duplicate, but the second cashier gets ORA-00001 in front of the customer. You turned a silent bug into a loud one; you didn't fix it.&lt;br&gt;
• Retry on error. It can work, but under load you get sessions looping and colliding again.&lt;br&gt;
• LOCK TABLE, or SELECT ... FOR UPDATE on a counter row. This does prevent duplicates, by making every session wait in line. The whole system now issues one invoice at a time, and the lock is held until the entire transaction finishes, not just until the number is computed.&lt;br&gt;
On top of that, MAX on a table with millions of rows costs an index read on every invoice, and sometimes a full scan if you filter by branch or year.&lt;br&gt;
Sequences: a counter that waits for no one&lt;br&gt;
CREATE SEQUENCE invoice_seq&lt;br&gt;
  START WITH 10453&lt;br&gt;
  CACHE 50;&lt;/p&gt;

&lt;p&gt;INSERT INTO invoices (invoice_no, ...)&lt;br&gt;
VALUES (invoice_seq.NEXTVAL, ...);&lt;br&gt;
The key difference: a sequence lives outside the transaction. NEXTVAL hands you a number and moves on immediately. It doesn't read the table and doesn't wait for anyone's commit.&lt;br&gt;
• No duplicates: every session gets a number no one has taken, regardless of how many sessions there are.&lt;br&gt;
• No queue: a thousand cashiers can pull numbers at the same instant.&lt;br&gt;
• No table reads: with CACHE, numbers are reserved in memory, so most calls never touch disk.&lt;br&gt;
One expression instead of a SELECT, a MAX and a lock, and it's faster and safer than both.&lt;br&gt;
"But sequences leave gaps"&lt;br&gt;
True. A ROLLBACK, or an instance restart that drops the cache, and you'll see missing numbers: 10452, then 10455.&lt;br&gt;
That isn't a defect. It's the price of having no queue. A number once handed out never comes back, because taking it back would mean one session waiting on another to decide.&lt;br&gt;
The real question is whether gaps actually matter to you:&lt;br&gt;
• If the number is an internal key (an ID), nobody cares about gaps. Use a sequence and move on.&lt;br&gt;
• If there's a legal or accounting requirement for gapless numbering, separate the two. Keep the ID from a sequence, and generate the customer-facing serial number only at final posting, from a counter table with FOR UPDATE. The queue now sits on one small step at the end, not on the whole sale.&lt;br&gt;
From 12c on: let the table handle it&lt;br&gt;
On Oracle 12c or later, you don't need to wire up a sequence and a trigger yourself:&lt;br&gt;
CREATE TABLE invoices (&lt;br&gt;
  invoice_id NUMBER GENERATED ALWAYS AS IDENTITY,&lt;br&gt;
  ...&lt;br&gt;
);&lt;br&gt;
Under the hood it's a regular sequence, but bound to the column, so no one can insert a manual value by mistake. If you need to supply values during a migration, use BY DEFAULT ON NULL instead of ALWAYS.&lt;br&gt;
The takeaway&lt;br&gt;
MAX()+1 assumes you're alone in the database. A system that makes money is never alone.&lt;br&gt;
A sequence isn't "another way" to do the same thing. It's a tool built for exactly this problem: unique numbers, no queue, no table reads. The gaps it leaves cost far less than two invoices with the same number.&lt;br&gt;
Have you found MAX()+1 in code you inherited? Did it bite you, or is it still waiting?&lt;/p&gt;

&lt;h1&gt;
  
  
  Oracle #PLSQL #Database #SQL
&lt;/h1&gt;

</description>
      <category>backend</category>
      <category>database</category>
      <category>programming</category>
      <category>sql</category>
    </item>
    <item>
      <title># The Suspiciously Round Number That Stopped Me Cold</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Sun, 13 Sep 2026 23:25:05 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/-the-suspiciously-round-number-that-stopped-me-cold-2n6e</link>
      <guid>https://dev.to/hossam_assadallah_842151a/-the-suspiciously-round-number-that-stopped-me-cold-2n6e</guid>
      <description>&lt;p&gt;I was pulling data from SAP through an OData API — every Internal Order from 2020 to today. The response came back with exactly 1000 rows. Not 987, not 1214. A clean, round 1000.&lt;/p&gt;

&lt;p&gt;Was I happy? No. I got suspicious.&lt;/p&gt;

&lt;p&gt;In data work, a number that "too perfect" is usually a lie. Real data comes back messy — fractions, odd totals, nothing that lines up so neatly. That 1000 wasn't telling me "here's your data." It was telling me "this is a ceiling."&lt;/p&gt;

&lt;p&gt;I tried the standard fix: paginate using OData's own &lt;code&gt;$skip&lt;/code&gt; and &lt;code&gt;$top&lt;/code&gt; parameters. SAP's gateway ignored both completely and kept returning the exact same first 1000 rows, as if the parameters didn't exist. There was no &lt;code&gt;__next&lt;/code&gt; link in the response either — nothing pointing to a next page.&lt;/p&gt;

&lt;p&gt;So I tried a different check. I ran &lt;code&gt;$count&lt;/code&gt; (a request that returns just the row count, no data) over the same date range — and got 1000 again. Even the count itself was capped by the same limit. I split the range in half and ran &lt;code&gt;$count&lt;/code&gt; on each half separately: 938 on the first half, 651 on the second. Real total: 1589. Not 1000.&lt;/p&gt;

&lt;p&gt;589 rows would have quietly disappeared, and nobody would have known — if I hadn't been suspicious of a number that looked too clean.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The lesson:&lt;/strong&gt; any time an API can return a lot of data, assume it's silently capped until you prove otherwise. A round number isn't a sign of success — it's the first flag that something needs verification. And trusting the standard protocol alone isn't enough: here, SAP's own gateway simply didn't honor OData's standard pagination mechanism. The fix is building independent verification — like splitting time windows and cross-checking partial counts — before you trust any number an API hands you.&lt;/p&gt;

&lt;p&gt;Have you run into this? An API silently truncating your data without telling you?&lt;/p&gt;

&lt;h1&gt;
  
  
  SAP #OData #DataEngineering #NodeJS #OracleAPEX #SoftwareEngineering #API
&lt;/h1&gt;

</description>
      <category>hossamassadallah</category>
      <category>oracle</category>
      <category>node</category>
      <category>fastapi</category>
    </item>
    <item>
      <title>"Boredom Isn't the Enemy of Creativity — Knowing When to Stop Is the Skill</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Sun, 13 Sep 2026 03:26:46 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/boredom-isnt-the-enemy-of-creativity-knowing-when-to-stop-is-the-skill-5co</link>
      <guid>https://dev.to/hossam_assadallah_842151a/boredom-isnt-the-enemy-of-creativity-knowing-when-to-stop-is-the-skill-5co</guid>
      <description>&lt;p&gt;The second English piece from "Psychology of the Keyboard," a series I write about the mental side of being a programmer — the part nobody puts in the documentation.&lt;br&gt;
I was standing at the sink, mid-wudu — not in front of a laptop, no editor open, not a single line of code in front of me — and the solution just jumped into my head. I'd been stuck on a bug for two days: an integration issue between FastAPI and Oracle. I'd tried everything — changed the query, dug through the documentation, asked everyone I could think of. Nothing. Then, while washing my hands, with zero warning, I suddenly understood: the problem wasn't in the code at all. The connection pool wasn't closing properly before it reopened. Something embarrassingly simple — but my mind couldn't see it while I was sitting there forcing focus.&lt;br&gt;
That's not a coincidence. In cognitive psychology it's called the Default Mode Network — the part of your brain that activates when you're not demanding conscious focus from it: washing dishes, walking, showering. In those moments, your brain isn't off. It keeps working quietly in the background, connecting pieces of information that were scattered while you were focused, which is exactly what produces that "sudden" solution.&lt;br&gt;
The problem is that we're trained, as programmers, to believe the answer comes from pressure — the harder you focus, the faster you'll find it. That's true, up to a point. Past that point, it works in reverse. When your brain sits on the same problem for two hours straight, it drops into a narrow tunnel of focus that shuts out every other possibility, and just keeps circling the same idea that already failed.&lt;br&gt;
Boredom isn't the enemy of creativity. Boredom is the door that opens that space — when you let yourself get distracted for a bit, without a phone, without a screen, not to be lazy, but to give your brain the chance to work in a completely different mode than the one you're used to at your desk.&lt;br&gt;
Take this as a rule, not a luxury: when you're stuck in front of a problem and can't move a single step forward, step away. Not just to rest your body — to give the other half of your mind room to work.&lt;br&gt;
Has a coding solution ever come to you while you were nowhere near a computer? Tell me where, and when.&lt;/p&gt;

</description>
      <category>hossamassadallah</category>
      <category>oracle</category>
      <category>career</category>
      <category>mentalhealth</category>
    </item>
    <item>
      <title>The 3 A.M. Moment Every Programmer Lies to Themselves About</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Sat, 12 Sep 2026 20:27:28 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/the-3-am-moment-every-programmer-lies-to-themselves-about-2e3f</link>
      <guid>https://dev.to/hossam_assadallah_842151a/the-3-am-moment-every-programmer-lies-to-themselves-about-2e3f</guid>
      <description>&lt;p&gt;The second English piece from "Psychology of the Keyboard," a series I write about the mental side of being a programmer — the part nobody puts in the documentation.&lt;/p&gt;

&lt;p&gt;It was around three in the morning. I'd been in front of the screen since nine at night, staring at the same line of code for what felt like the hundredth time. The function looked perfect on paper — no visible issue — but the result kept coming out wrong. I tried everything I could think of: changed the condition, dug through Stack Overflow, asked an AI. Nothing changed.&lt;/p&gt;

&lt;p&gt;I still remember exactly what I felt in that moment. It wasn't physical tiredness. It was something else entirely — a feeling that I wasn't good enough, that maybe the problem was in my own head, not in the code. That if my colleagues saw me stuck like this, they'd assume I was a beginner, not someone running a company that builds systems handling real data.&lt;/p&gt;

&lt;p&gt;That's the thing almost nobody talks about in programming. We talk about algorithms, best practices, the newest framework — but nobody tells you this profession takes as much from your mental health as it does from your time.&lt;/p&gt;

&lt;p&gt;In that moment of being stuck, something happens in your brain called tunnel vision. Your mind locks onto the same path you already tried and failed on, and keeps pulling you back to it — not because the answer is there, but because a tired brain finds it easier to repeat the same move than to open a new path. The dangerous part of that moment isn't failing. It's staying seated, convinced that continuing in the same direction is the answer — which is exactly what turns one exhausting hour into two or three wasted ones.&lt;/p&gt;

&lt;p&gt;The fix isn't to be "strong" and push through. The fix is giving yourself real space away from the screen — even five minutes. Walk. Drink water. Look at something completely different. The mind isn't a machine; it needs to reorganize itself. And when you come back, you'll often find your eyes suddenly see something that had been sitting in front of you for two hours, unseen.&lt;/p&gt;

&lt;p&gt;One more thing worth saying clearly: your value as a programmer isn't in solving everything fast. It's in continuing even when a lot of things don't get solved on the first try. Every professional programmer has been through the exact moment I just described. The difference is learning when to stop and when to keep going — not that they stopped getting lost altogether.&lt;/p&gt;

&lt;p&gt;Have you had a moment like this? What actually helps you find your focus again?&lt;/p&gt;

</description>
      <category>hossamassadallah</category>
      <category>oracle</category>
      <category>programming</category>
      <category>gooshylx</category>
    </item>
    <item>
      <title>What Training an AI Agent Taught Me About Letting Go of Control</title>
      <dc:creator>Hossam Assadallah</dc:creator>
      <pubDate>Sat, 12 Sep 2026 18:25:21 +0000</pubDate>
      <link>https://dev.to/hossam_assadallah_842151a/what-training-an-ai-agent-taught-me-about-letting-go-of-control-40an</link>
      <guid>https://dev.to/hossam_assadallah_842151a/what-training-an-ai-agent-taught-me-about-letting-go-of-control-40an</guid>
      <description>&lt;p&gt;his is the first English piece from "Psychology of the Keyboard," a series I write about the mental side of being a programmer — the part nobody puts in the documentation.&lt;/p&gt;

&lt;p&gt;I was training the AI agent behind Amin, the product I've been building, and I had the exact reply mapped out in my head for every question it should get. I wrote the prompt, reviewed it, tuned it, ran the test. The reply came back — not wrong, exactly, just not phrased the way I'd already decided it should be. I went back, adjusted, tried again. A third reply came out, different from the first two. And I felt something strange. Not frustration at the model's performance — a feeling that I was losing control over something I had built from scratch.&lt;/p&gt;

&lt;p&gt;I paused the training. Not because the model was wrong, but because I couldn't tolerate a system I'd built with my own hands producing responses I didn't control 100%. That made me think — this wasn't the first time I'd felt this. It shows up in everything I build, from the database layer to the UI: I want every detail under my control, completely.&lt;/p&gt;

&lt;p&gt;And that instinct makes perfect sense in our profession. We're trained to believe that one point outside our control can break the whole system, so we've been conditioned to treat total control as the only real safety. The problem is that mindset doesn't stay inside the code. It follows you out. You catch yourself wanting to control an employee's reaction, a client's decision, even your own kid's mood mid-conversation — because your brain has learned that "no full control means danger."&lt;/p&gt;

&lt;p&gt;But an agent, like any AI system, is built on probability, not fixed rules. It's not supposed to give you the exact same wording every time — that's not a flaw, that's its nature. The real lesson wasn't figuring out how to make the output 100% consistent. The lesson was learning to separate "controlling the general direction" from "controlling every word." I needed to tune the framework and the rules, not micromanage every small detail inside it.&lt;/p&gt;

&lt;p&gt;Once I let the agent take up more space inside the framework I'd set, the responses got more natural and closer to each customer's actual tone — not because I'd gotten less precise, but because I'd gotten confident that the framework itself was enough.&lt;/p&gt;

&lt;p&gt;Have you ever caught yourself trying to control something that was never meant to be fully controlled, at work or outside it? How did you know it was time to let go?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
