I encountered some error in instantiate a cell into a top cell. When i tyring to get the cell view id by using function dbGetOpenCellViewByType(Lib Cell View "" "a") and it return me a warning message:
*WARNING*dbOpenCellViewByType: Unable to lock database file for Lib/Cell/View
when this warning happen, it will failed to execute other functions. Please advice.
Thanks a lot.
If you're instantiating a cellView in another view, there's no particular need to open the master in "append" mode. The master can just be in read mode (i.e. pass "r" instead of "a". What it is telling you is that it can't lock it - which will happen if:
If it fails to open in append mode (and can't lock it), dbOpenCellViewByType() will just return nil - and that's probably why further things went wrong.
In reply to Andrew Beckett:
Thanks for your fast reply. =D.
It means i have to check the cell before open it? I thought if i already open the cell view some where, dbOpenCellViewByType is still working rite? Because last time it use to be working fine.
In reply to kbhow:
I don't understand your question. If you just open it readonly, there'll be no problem. Unless there's some reason why you need to open it in "append" mode?
You should really always check the return value of dbOpenCellViewByType() to ensure that you managed to open whatever you're trying to open, whether in append or read mode.
Thanks for your reply. My attempt is to open the cell in "append" in nograph mode to perform some operation. This use to failed when dbOpenCellViewByType unable to open the cell and return nil. Do you mind providing me some idea how to handle this issue?
Where there is a need the cell view is already open by user, and another function is running in nograph mode.
Thanks in advance.
Well, quite simply, you cannot open the same cellView for edit in more than one session at the same time. This is to prevent data loss - otherwise you both would be editing the same data, and whoever saved last would win, and the work done in the other session would be lost.
Your options are:
That's really all I can think of - without understanding what you're actually trying to do, it's hard to advise further. Even then, this is a fundamental limitation (for very good reasons) of the tools, so you need to operate within those constraints.
Thanks a lot for your suggestion. I would like to go for option 1 and 2.