Home > Community > Forums > Custom IC SKILL > dbOpenCellViewByType: Unable to lock database file

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 dbOpenCellViewByType: Unable to lock database file 

Last post Mon, Nov 2 2009 10:02 PM by kbhow. 6 replies.
Started by kbhow 02 Nov 2009 01:06 AM. Topic has 6 replies and 3963 views
Page 1 of 1 (7 items)
Sort Posts:
  • Mon, Nov 2 2009 1:06 AM

    • kbhow
    • Top 75 Contributor
    • Joined on Wed, May 6 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    dbOpenCellViewByType: Unable to lock database file Reply

    Hi,

    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.

    How

    • Post Points: 20
  • Mon, Nov 2 2009 1:35 AM

    Re: dbOpenCellViewByType: Unable to lock database file Reply

    How,

    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:

    1. The view is readonly
    2. Somebody else (including you in another session) has it open for edit already

    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.

    Best Regards,

    Andrew.

    • Post Points: 20
  • Mon, Nov 2 2009 1:40 AM

    • kbhow
    • Top 75 Contributor
    • Joined on Wed, May 6 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: dbOpenCellViewByType: Unable to lock database file Reply

    Hi Andrew,

    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.

    How

    • Post Points: 20
  • Mon, Nov 2 2009 1:53 AM

    Re: dbOpenCellViewByType: Unable to lock database file Reply

    Hi How,

    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.

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Nov 2 2009 4:31 PM

    • kbhow
    • Top 75 Contributor
    • Joined on Wed, May 6 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: dbOpenCellViewByType: Unable to lock database file Reply

    Hi Andrew,

    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.

    How

    • Post Points: 20
  • Mon, Nov 2 2009 9:41 PM

    Re: dbOpenCellViewByType: Unable to lock database file Reply

    Hi How,

    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:

    1. Give a sensible error message and exit gracefully when you cannot open something for edit
    2. Open it read only instead.
    3. Use dbCopyCellView() to copy the cellView to another (say) viewName, and then open that for edit (probably not desirable though)
    4. Open in "s" (scratch) mode (although you won't be able to save any modifications made, may be OK - depends on what you're trying to do).

    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.

    Regards,

    Andrew.

    • Post Points: 20
  • Mon, Nov 2 2009 10:02 PM

    • kbhow
    • Top 75 Contributor
    • Joined on Wed, May 6 2009
    • Penang, Pulau Pinang
    • Posts 120
    • Points 2,045
    Re: dbOpenCellViewByType: Unable to lock database file Reply

    HI Andrew,

    Thanks a lot for your suggestion. I would like to go for option 1 and 2.

    How

    • Post Points: 5
Page 1 of 1 (7 items)
Sort Posts:
Started by kbhow at 02 Nov 2009 01:06 AM. Topic has 6 replies.