Unix Technical Forum

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

This is a discussion on OO4O, BLOB, AddNew and "Row must be locked" within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hi there, I have no success with inserting a BLOB into a new record. I always get the message ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database > Oracle Miscellaneous

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-08-2008, 08:24 AM
Wiwo
 
Posts: n/a
Default OO4O, BLOB, AddNew and "Row must be locked"

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:26 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com