Thursday, April 29, 2010

LOAD JSP during startup.

You can load jsp during startup by create JSP servlet in web.xml


         HomeJsp
         /home.jsp
         1

 

Use Decimal(19,0) for BIGINTEGER

We have an existing application that runs on WebSphere using DB2 UDB v8.0 as the database. The version of DB2 supports BIGINT which is a 64 bit integer, a Java long primitive. All of our entity beans use a long primitive to store a timestamp.

DB2/390 does not have a BIGINT data type. It only has a 32 bit integer. Has anyone tried to map a 64 bit integer in an entity bean to a DB2/390 data type? I'm thinking it's going to be a DECIMAL but I'm not sure. I want to get some opinions before I start experimenting.

answer:Use Decimal(19,0), this was recommended to me by an IBM DB2 AIX to Z/OS migration expert.


reference 

Wednesday, April 21, 2010

The top 10 (more or less) J2EE best practices

Always use MVC.
Apply automated unit tests and test harnesses at every layer.
Develop to the specifications, not the application server.
Plan for using J2EE security from Day One.
Build what you know.
Always use Session Facades whenever you use EJB components.
Use stateless session beans instead of stateful session beans.
Use container-managed transactions.
Prefer JSPs as your first choice of presentation technology.
When using HttpSessions, store only as much state as you need for the current business transaction and no more.
In WebSphere, turn on dynamic caching and use the WebSphere servlet caching mechanism.
Prefer CMP Entity beans as a first-pass solution for O/R mapping due to the programmer productivity benefits.




http://www.ibm.com/developerworks/websphere/techjournal/0405_brown/0405_brown.html#author2

Tuesday, April 20, 2010

Session TIme out in Websphere

HTTP Session time-out Override Precedence Summary

The list below shows the precedence from which the final HTTP Session time-out is derived.

1. Server Level Lowest level
2. Enterprise Application Overrides the Server Level if Override is selected
3. Web Application Overrides the Server and Enterprise Application settings if Override is selected
4. Application Level (web.xml) Overrides Server, Enterprise Application, and Web Application settings
5. Application Code Overrides all other settings

In conclusion, we can load session timeout from local db and overide using application code.

For more info, refer  IBM support

Monday, April 12, 2010

Show full process name / path / string in Solaris using args

Using
ps -ef | grep java
in Solaris cant see all parameter pass to java. /bin/ps(default) will crop your process name.

Example
sit:ps -ef | grep java
wasadmin  4170 14515   0 09:43:34 ?           1:45 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=44691 -D
wasadmin 14567  1839   0   Mar 24 ?          83:40 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=39108 -X
wasadmin 14466  1839   0   Mar 24 ?         104:34 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=38668 -X
wasadmin 14515  1839   0   Mar 24 ?          85:00 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=38859 -X
wasadmin 28302  1839   0   Mar 25 ?          96:09 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=58191 -X
wasadmin  5806  1839   0   Mar 25 ?         200:20 /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=63240 -X
wasa



Use defaut
/bin/args
by pass in the processID into it.

example
sit:pargs 3054
3054:   /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java -Dwas.status.socket=4
4421 -D
argv[0]: /opt/IBM/WebSphere/AppServer/java/bin/sparcv9/java
argv[1]: -Dwas.status.socket=44421
argv[2]: -Declipse.security
argv[3]: -Dosgi.install.area=/opt/IBM/WebSphere/AppServer
argv[4]:

reference
http://www.davidyahalom.com/index.php/show-full-process-name-path-string-in-solaris-using-ps/

Friday, April 09, 2010

Jquery, disable input button

Very usefull to disable/enable input button by using jquery



(function($) {
//disable download attachment when on change search criteria
$('.report-form-container :input').change(function() {
$(':input[name^=report_redirect:]').attr('disabled', true);
});
//enable download attachment when search button click.
$(':input[name^=search:]').click(function() {
$(':input[name^=report_redirect:]').attr('disabled', false);
});