I have a Java code for Oracle with which I keep a file in the database, the file is stored in a Blob field, for this purpose I use a "select for update" and put the connection in "autocommit (false ) "to keep the channel open to that record, after that I keep that result in a Blob and then write content to an OutputStream, then do" commit "and put the connection back to" autocommit (true) ".
The question is, how I can do a "select for update" for SQL Server 2008? I've been reading that possibly with a "WITH (ROWLOCK)" in my select, but if I do so, after you commit to writing the OutputStream object is unlocked automatically? or what is the procedure?
Thanks for listening.