Are you receiving my emails?
jda
jda at his.com
Tue Nov 23 10:00:43 CST 2010
>Hello jda,
>
>Sunday, November 21, 2010, 2:34:57 PM, you wrote:
>
>Well, really strange things...
>Open that db with vStudio (as before) and now I see some records
>(~100). And more compact now do nothing because all database segments
>are in use.
>
>BTW, 69338 segments on the volume and 271 segments
>are allocated for segment-map!
>
>Now I see - the BLOB occupies ~140Mb.
>After cloning this BLOB occupies ~20Mb.
>
>
>So my assumption is different now.
>Somehow BLOB may loss some BLOB-segments. For example - putting some
>data to the BLOB and forget to "commit" it with either AddRecord or
>UpdateRecord, but move to another recID instead. Of course, there
>are some guards
>in our code which should prevent such orphan segments but anyway
>you should avoid such situation:
>
>tbl.SetBlank()
>fldBlob.WriteData( pData )
>.... no AddRecord()
>tbl.NextRecord
>
>or
>
>tbl.FirstRecord
>fldBlob.WriteData( pData )
>.... no UpdateRecord()
>tbl.NextRecord
>
>Could you describe more detailed how blob data comes to the database?
Sure. All writing to this file goes through this REALBasic method:
myCursor = prefsDB.SqlSelect("SELECT " + fieldName + " from prefs
where propertyName='" + propertyName + "'",
EVCursorLocation.kServerSide, EVLockType.kReadWrite)
if myCursor <> nil and myCursor.recordCount = 1 then
if fieldName <> "blobField" then
if VarType(propertyValue) = 8 then
myCursor.Field(fieldName).setString(propertyValue.StringValue)
else
myCursor.Field(fieldName).setString(propertyValue)
end if
else
if VarType(propertyValue) = 8 and propertyValue.StringValue =
"" then //it's an empty string. Delete the blob, don't insert an
empty string!
myCursor.BlobField(fieldName).DeleteData
else
myCursor.BlobField(fieldName).WriteRawData(propertyValue)
end if
end if
myCursor.updateRecord
prefsDB.flush
>
>BTW - what valentina version was used?
>
Since this was submitted by a user I can't be sure what version he
was using. I'm currently using 4.7.
Jon
More information about the Valentina
mailing list