Good to hear from you, Lars.
No filters involved - as mentioned above, the problem occurs with a variety of tables, with a variety of embedded SQL, and with at least one datastore.
By way of example, the application, on booting, checks a whole raft of tables to update them programmatically with lookup data or additions to drop-down lists tables etc.
The respective SQL checks to see if the value exists, usually by embedded SQL, and if the value in question is not retrieved/selected, following SQL code adds the new, and ostensibly missing, value.
This adding of the 'new' values results in a series of DB errors, such as duplicate keys, as the application attempts to add values which already exists.
This in turn indicates that a different database is not being accessed.