Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

USE OF FINALIZE IN EJB'S

843829Aug 29 2002 — edited Aug 30 2002
Hi

1//
I have a method that performs a delete statement on the database and this method is called inside ejbRemove(Stateful session bean).

How different is this from using a finalize method and in that giving a call to the method that performs the delete.


2//
we are using jboss server for deployment of our EJB's.The finalize method that we had put in the stateful session bean generates a warning "Finalize method not allowed here".Why is that so??

thx in advance

Comments

843811
Such optimization are done by JIT compiler (not by javac).
C++ have just the same problems, exceptions make CFG analisis more difficult but not impossible.
PS You can read JLS about volatile variables there some additional restrictions on them.
843811
zhmur is right, this makes optimization harder not impossible.

There are sicentific papers aimed at making more analysis/optimization in the presence of many try/catch blocks. For instance, JIT can reorder statements, and then put compensation code into the catch body, recovering program state back if an exception was thrown.

General principle is simple: exceptions are rare. So JIT optimizes the "normal" control flow by the cost of more complex catch body.

You may also look/post to the comp.compilers newsgroup regarding compilers and optimization techniques

Denis

-----------------------------
www.excelsior-usa.com/jet.html
High-Performance JVM for J2SE
1 - 2
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 27 2002
Added on Aug 29 2002
2 comments
397 views