It is excessively "not clear at all" what is happening or what you are doing.
I don't know how you implemented this logic - how does a user "get a warning message", the database itself doesn't know how to do that - so, this must be entirely in the application.
there is always a table lock taken, in row share exclusive mode, when you select for update, not just when you notice something. It has to be there, it is used to protect the table from DDL during this transaction. It blocks only DDL and other operations that attempt to exclusively lock this table.
ops$tkyte%ORA10GR2> create table t as select * from dual;
Table created.
ops$tkyte%ORA10GR2>
ops$tkyte%ORA10GR2> select lock_type, mode_held, (select nvl(max(object_name),LOCK_ID1) from user_objects where object_id = LOCK_ID1) obj
2 from dba_locks where session_id = (select sid from v$mystat where rownum=1);
no rows selected
ops$tkyte%ORA10GR2> select * from t for update;
D
-
X
ops$tkyte%ORA10GR2> select lock_type, mode_held, (select nvl(max(object_name),LOCK_ID1) from user_objects where object_id = LOCK_ID1) obj
2 from dba_locks where session_id = (select sid from v$mystat where rownum=1);
LOCK_TYPE MODE_HELD OBJ
-------------------------- --------------- ------------------------------
DML Row-X (SX) T
Transaction Exclusive 524306
ops$tkyte%ORA10GR2> lock table t in exclusive mode;
Table(s) Locked.
ops$tkyte%ORA10GR2> select lock_type, mode_held, (select nvl(max(object_name),LOCK_ID1) from user_objects where object_id = LOCK_ID1) obj
2 from dba_locks where session_id = (select sid from v$mystat where rownum=1);
LOCK_TYPE MODE_HELD OBJ
-------------------------- --------------- ------------------------------
DML Exclusive T
Transaction Exclusive 524306
You would need to sketch this out much better, including for example - well, an example.
test cases must be:
a) concise
b) yet 100% complete, so we can run them
c) but most importantly small
d) but all there