dbTalk Databases Forums  

OO4O, BLOB, AddNew and "Row must be locked"

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss OO4O, BLOB, AddNew and "Row must be locked" in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Wiwo
 
Posts: n/a

Default OO4O, BLOB, AddNew and "Row must be locked" - 12-23-2005 , 03:01 AM






Hi there,

I have no success with inserting a BLOB into a new record. I always get
the message "Row must be locked for this operation". My code:

create table TEST (
MYBLOB blob default empty_blob()
);

Dim objOraSession As OraSession
Dim objOraDatabase As OraDatabase
Dim objOraDynaset As OraDynaset
Dim objOraField As OraField
Dim objOraBlob As OraBlob

Set objOraSession = New OraSessionClass
Set objOraDatabase = objOraSession.OpenDatabase("database",
"user/password", 2)
Set objOraDynaset = objOraDatabase.CreateDynaset("SELECT * FROM
test", 2)
Set objOraField = objOraDynaset.Fields("myblob")
Set objOraBlob = objOraField.value

objOraDatabase.BeginTrans
objOraDynaset.AddNew
objOraBlob.CopyFromFile "d:\test.txt"
objOraDynaset.Update
objOraDatabase.CommitTrans

When I first save the record and then use objOraDynset.Edit the
operation succeeds. But I can't use this design in my application, I
need to do all in one transaction, and the new record is only usable
after commiting the transaction. Otherwise I will not be able to
rolback the whole changes.

So is there no way to lock a row when I use AddNew or is there another
possibilty to do this?

Many thanks for your help
Wiwo


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.