Oracle - Lock preventing SELECT

Asked

Viewed 206 times

1

Lock preventing SELECT

The situation is as follows :

An ERP application (Totvs) with multiple tables All these tables use as primary key a standard field R_E_C_N_O_

The application (I believe) creates a new record with a select max(R_E_C_N_O_)+1

But I need a package plsql create records in some of these tables but when competing with ERP errors occur by ORA-00001: restric? the exclusive

My question is : Is there any syntax where it is possible "lockar" the max(R_E_C_N_O_) in the case of a specific table ?

The idea is to have a "Wait" and not allow that the ERP application and the package have the same futureR_E_C_N_O_ .

I remember that I have no way to change the ERP Everything should be in the PLSQL package

And of course minimizing the possibility deadlocks

  • Why don’t you create a sequence?

  • Grateful @Everson , but as I said the application already exists I can’t change it I have to make a plsql block live with what already exists and avoid the conflict of Pks

  • 1

    Do you have DBA access on this Oracle base? If I’m not mistaken, in Oracle TOTVS bases, R_e_c_n_o_s are implemented using triggers and sequences. In this case, it would only be the case that you use this same SEQUENCE object as the TOTVS.

  • I have access , in our case at least it is not by TRIGGER and the application layer, I believe that internally it is even max(recno)+1

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.