[V4MD] Intermittent setMedia

Scott Runkel srunkel at hypix.com
Tue May 11 10:48:58 CDT 2004


I'm using setMedia in Director to place #text members into BLOB fields. It works
fine about 98% of the time, but a small percentage of the time it fails. There
is no error reported upon setMedia or getMedia, but when I use getMedia there is
just nothing there sometimes. These failures are totally unpredictable. One time
I will loop through 250 #text members and put them all into the database, and
certain ones (5 to 10 of them) will be missing. The next time, it will be a
different set, and ones that were fine are no longer there. These are pretty
small #text members, less than a page, nothing fancy, Arial, no tables or
anything.

Other times there will be one or two members that crash Director completely when
I try to use getMedia on them (DMX, Windows XP).

I seem to be able to fix both problems by using setMedia again directly on the
problematic item (as opposed to my loop below). The code is the same, however,
except for the looping part.

For the cursor locktype for setMedia, I have tried readwrite (3) and nolock (1)
and both have the same problem.

The BLOB field settings are segment size 128, no encryption, not indexed, not
unique, not nullable, not compressed.

Here's my code for setMedia:

sql = "select * from sa where year = " & whichYear

  goCursor = new(Xtra "VCursor", GetRef(goDB), sql, 2, 1, 2)

  yearCount = getRecordCount(goCursor)

  repeat with x = 1 to yearCount
    goToRecord(goCursor, x)

    critiqueMemberName = "SAC-" & string(whichYear) & "-" & string(pad(x))

    SetMedia (goCursor, "mediac", member critiqueMemberName)
    put valentinaError()

    UpdateRecord(goCursor)
  end repeat
  Flush( goDB )

Here's my code for getMedia:

cursor = new(Xtra "VCursor", GetRef(pDB), sql, 2, 2, 2)
GetMedia (cursor, "mediac", member "TEXT:Current Critique" )

-SR

Scott Runkel
Director of Technology
Hypix Media, Inc.
503-722-2123




More information about the Valentina mailing list