Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / April 2004

Tip: Looking for answers? Try searching our database.

handle blob in ejb

Thread view: 
- 09 Apr 2004 15:24 GMT
In Oracle database, if I want to insert or update LOB, I have to use

Connection.setCommit(false);

ResultSet resultSet = Statement.executeQuery("select ... for update");

Blob blob = resultSet.getBlob();

InputStream inputStream = blob.getInputStream();

...

Connection.commit();

How do I implement the above code in ejb because I can not run any
setCommit() or commit() in ejb container?

Jim
Igor N. Kolomiyets - 09 Apr 2004 20:14 GMT
You actually can. If you specify
<transaction-type>Bean</transaction-type> in the deployment descriptor.
The container should allow you to use driver transaction context in this
case. But it is stronglly suggested to use the container transaction
context instead:

UserTransaction trans = context.getUserTransaction();
....
trans.begin();
ResultSet resultSet = Statement.executeQuery("select ... for update");

Blob blob = resultSet.getBlob();

InputStream inputStream = blob.getInputStream();
trans.commit();

Transaction type should be set to Bean anyways.

Best regards,
Igor.

> In Oracle database, if I want to insert or update LOB, I have to use
>
[quoted text clipped - 14 lines]
>
> Jim


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.