Need help on Error: Failure getting table lock on table PUB.

Posted by Vel murugan on 01-Aug-2016 06:29

In my application I am trying to add a column to the table, I will be using the column as unique identifier to update the other columns of the table.

In order to do that, i am locking the table in exclusive mode and then adding the new column UNIQ_ID. I am getting the below error while trying to alter the table.

Update Query : LOCK TABLE PUB."customer" IN EXCLUSIVE MODE
Update Query : ALTER TABLE PUB."customer" ADD (UNIQ_ID integer)
java.sql.SQLException: [DataDirect][OpenEdge JDBC Driver][OpenEdge] Failure getting table lock on table PUB._File.

what am I missing here?

All Replies

Posted by sjardosh on 01-Aug-2016 07:58

are these queries in same transaction?  Could you please check record locks in promon before executing these queries?

Posted by Vel murugan on 01-Aug-2016 08:26

[mention:389909557cd7468ea9b3b4205c5772e0:e9ed411860ed4f2ba0265705b8793d05] Yes..all the queries are in the same transaction. before executing these queries record lock is not ther..

Posted by Keith Sudbury on 01-Aug-2016 08:36

Making online schema changes in OE isn't quite the same as with other databases. Quite a bit depends on your exact version of OE, if the table is SQL or ABL (yours is ABL) and if other users are connected to the database at the same time (and what they are doing).

Posted by Vel murugan on 01-Aug-2016 10:45

there will be only one user connected to the database. the OE version is v11.6. i am using java database connectivity - openedge.jar.

Posted by smat-consulting on 01-Aug-2016 11:27

You keep asking what you are missing - can't help but mention: you appear to me like a person that has a Prius in the driveway and desperately tries to tie some horses in front of it so he can go to the grocery store! :)

I'd suggest instead of spending all that time and effort in doing what you're trying to do using whatever tool you are using, to rather look into the whole OpenEdge tool, check out the ABL, and get your project done in no time... :)

But, hey, horse drawn Prius is surely a nice picture, too...

Enjoy

This thread is closed