Do Not Call System Exit: Web applications should not call System.exitQ, since only the web container or the application server should stop the JVM.
Static EJB Field Should Be Final: According to the J2EE specification, an EJB should not have any static fields with write access. However, static read only fields are allowed. This ensures proper behavior especially when instances are distributed by the container on several JREs.
Do Not Use Threads: The J2EE specification explicitly forbid use of threads.
Use Proper Class Loader: In J2EE getClassLoader() might not work as expected. Use Thread.currentThread().getContextClassloader() instead.
Close connections: Most Java programmers close a connection with the database directly—without closing the ResultSet or Statement. But not all JDBC drivers clean themselves up. To be safe, remember to close everything explicitly in reverse order, i.e. in the order of ResultSet, PreparedStatement, Connection.
Use appropriate transaction attribute: Avoid transaction overhead for non-transactional methods of session beans by declaring 'NotSupported' or 'Never' transaction attributes that avoid further propagation of transactions.
Thanks
A.T.J
Subscribe to:
Post Comments (Atom)
Excellent information.Thanks for sharing...
ReplyDeleteWorth reading! Our experts also have given detailed inputs about these trainings & courses! Presenting here for your reference. Do checkout oracle training in chennai & enjoy learning more about it.
ReplyDeleteReach to the best Python Training institute in Chennai for skyrocketing your career, Infycle Technologies. It is the best Software Training & Placement institute in and around Chennai, that also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.
ReplyDelete