I used "alter user scott account lock;" for lock the account.
Now i try to access database so oracle prompts a message user is locked.
but when i connect via website build in asp.net , I first time also get message via exception handling in front-side.
but when i also perform such operation like select quyery fire and update query then work well while user is lock!
I'm sock when user is lock and DML operation allow.
How it's possible?
If you lock an account, then any *future* connection will be blocked.
If you already have a connection open, then it will work fine.
SQL> conn scott/tiger
Connected.
--
-- from another session
--
SQL> alter user scott account lock;
User altered.
--
-- then back in the first session, its still fine
--
scott@np12
SQL> select count(*) from emp;
COUNT(*)
----------
14
--
-- but if I disconnect, then I can't get a new session
--
SQL> disc
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Advanced Analytics
and Real Application Testing options
scott@np12
SQL> conn scott/tiger
ERROR:
ORA-28000: the account is locked
From a web tier, it might be an issue of connection pooling, so there is a mix of existing sessions and new sessions being utilised which would give pseudo-random behaviour.