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