How to Artificially Lock Tables for Testing Purposes

Solution:

It may be necessary to artificially lock tables to troubleshoot potential issues in Sage Pro ERP. For example if the rollback process is suspected of causing a problem, it is possible to artificially lock the table in question to reproduce rollback situations. This can be very helpful in lieu of multiple users in the system to test rollback.

 

Refer to the examples for information on how to lock table in the Microsoft Visual FoxPro (VFP) and Microsoft SQL Server (SQL) versions of Sage Pro. In both examples, the SOTRAN table is used but this process may be used for any other table. The commands can be entered through FoxPro Access in Sage Pro and should be done from one workstation while the transaction test is done on another.

VFP

To lock the table:

go_Sql.m_OpenTable(“[give any alias]”, “[Full tablename including path]”)
go_Sql.cmp[alias given].m_LockFile()

 

Example
go_sql.m_Opentable(“a_sotran”, “c:\pro73\sampledata\sotran99”
go_sql.cmpa_sotran.m_LockFile()To unlock the table:go_sql.cmp[Alias].m_Unlock()

Example
go_sql.cmpa_sotran.m_UnLock()

SQL

To lock the table:

go_Sql.m_OpenTable(“[give any alias]”, “[databasename..tablename]”)
go_Sql.cmp[alias given].m_LockFile()

 

Example
go_sql.m_Opentable(“a_sotran”, “prosampledata..sotran”)
go_sql.cmpa_sotran.m_LockFile()

To unlock the table:

go_sql.cmp[Alias].m_Unlock()

 

Example
go_sql.cmpa_sotran.m_UnLock()

© Copyright Sage Software

Leave A Comment?