aspose file tools*
The moose likes JDBC and the fly likes reading BLOB data from oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "reading BLOB data from oracle" Watch "reading BLOB data from oracle" New topic
Author

reading BLOB data from oracle

rakkesh kumar
Ranch Hand

Joined: Oct 06, 2004
Posts: 37
is it mandatory to lock the row while inserting the data in to BLOB column.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Rakkesh,
Not the whole row. And the driver will take care of this for you.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
i dont think the driver will takecare of locking stuff. Oracle has a locking mechanism in there.

anyways, you need not do it explicitly.
rakkesh kumar
Ranch Hand

Joined: Oct 06, 2004
Posts: 37
i have locked the row using below Sql statement.

SELECT DATA FROM BLOBDATA WHERE id = ? FOR UPDATE


if i'm not doing it it is giving error like the row is not locked.

if i do this it's working properly
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Rakkesh,
The reasons for that is because you are doing multiple things in the same transaction. The row needs to be locked to make sure the data you are retieving is consistent with the data you are adding. Otherwise someone could change things in the middle and leave your data in an inconsistent state.

If you were just inserting the BLOB, the locking situtation would be different.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading BLOB data from oracle