GRID control and RLOCK()
Posted: Fri Feb 12, 2010 10:05 am
Hello Roberto,
I use the GRID control with PGRDD (Postgresql RDD). Unfortunately, pgrdd has a flaw: It does not support RLOCK()
It is usually no problem at all. My program runs fine, without rlock.
This is not an hmg-bug, but it causes some problems when saving data in a data-bound grid.
When the grid-control saves data, it tries to rlock the table (h_grid.prg in line 2098).
I tried to come up with a quick fix to the problem. and added IF RDDNAME() # "PGRDD". I know, it is very ugly, but does the trick. Postgresql does not need to be locked explicitly, so there should be no harm done.
So line 2098 of h_grid.prg looks like this:
and line 2112 now looks like this.
It worked and my data gets saved.
But now I ran into the next problem:
The function DataGridRefresh(index) loads an array of values:
This does not work. The value aValue [1] is empty.
I would really appreciate your help. I am stuck.
I use the GRID control with PGRDD (Postgresql RDD). Unfortunately, pgrdd has a flaw: It does not support RLOCK()
It is usually no problem at all. My program runs fine, without rlock.
This is not an hmg-bug, but it causes some problems when saving data in a data-bound grid.
When the grid-control saves data, it tries to rlock the table (h_grid.prg in line 2098).
I tried to come up with a quick fix to the problem. and added IF RDDNAME() # "PGRDD". I know, it is very ugly, but does the trick. Postgresql does not need to be locked explicitly, so there should be no harm done.
So line 2098 of h_grid.prg looks like this:
Code: Select all
* If unable to lock return
if RDDNAME() # "PGRDD" && raumi75
If Rlock() == .F.
MsgExclamation(_HMG_SYSDATA [ 136 ][9],_HMG_SYSDATA [ 136 ][10])
&cRecordSource->(dbgoto(nRecNo))
return .f.
endif
endif && raumi75
Code: Select all
* Unlock
if RDDNAME() # "PGRDD" && raumi75
&cRecordSource->(dbrUnlock(&cRecordSource->(recno())))
endif && raumi75
But now I ran into the next problem:
The function DataGridRefresh(index) loads an array of values:
Code: Select all
aValue := _GetValue ( , , index )
I would really appreciate your help. I am stuck.