Thursday, May 22, 2008

initial context - OOM

Creating intial context and not closing the context can lead to OOM condition based on the load. Either this needs to be cached or closed immediately after usage. Caching may not be possible when application connects to multiple App Server. Even though this is the better solution, some time forced to use close option. InitialContext.close makes that object GC collectable immediately. So it does not move tenured space, will be collected from new generation space.

Tuesday, April 29, 2008

How to find HP system version

uname -a

provides version of HP unix

getconf KERNEL_BITS

to find out 32 / 64 bit processor

Saturday, April 12, 2008

Relook logic

Its good to put some of the problems/issues for a small gap (say 5 to 7 days) and take a look again, it sure gives solution.

Wednesday, February 27, 2008

Weblogic server status check - UNIX command

To automate weblogic managed server startup steps, need to check Admin server status first. Then start managed server. Check managed server status before continuing next steps like bringing up services deployed. Found to be useful to use weblogic.Admin option to achieve this easily,

Here is the step to check Admin server status

. setEnv.sh
$JAVA_HOME/bin/java weblogic.Admin -url $admin_server PING 1 >/dev/null 2>&1
admin_server_status=$?

Step to check Managed server status

ms_server_status=`$JAVA_HOME/bin/java weblogic.Admin -url $admin_server GETSTATE $app_name grep -c RUNNING `

Tuesday, February 12, 2008

write small script to simplify deployment/bounce

Its good to automate all the process related to component bounce, application server bounce, deployment steps etc. It may look like a simple steps and need not require automation. But when we work on the same component for quite a long time we would have spent more time for just copy/pasting comments.

Making it as a simple script has several advanatges,
1. we dont need to remember each and individual commands and dont need to remember authentication details
2. all typo can be avoided
3. In the long run this can save lot of time
4. anyone can easily manage

example of scripting managed weblogic server:

startDemoApp1.sh

umask 002
WLS_USER=admin
WLS_PW=admin123
export WLS_USER
export WLS_PW
nohup ./startManagedWebLogic.sh demoapp1 t3://localhost:7200 $* > demoapp1.out 2>&1 &

stopDemoApp1.sh

./stopWebLogic.sh admin admin123 demoapp1 t3://localhost:7200

Thursday, February 7, 2008

UML Tools

Not all the freeware for UML is great. Each has its own advantages and disadvantages. So we are force to use Low cost product. I have been using enterprise architect tool for past 7 days and its cool. It has got all the basic feature and greatly integrated with svn. With the basic desktop version could share the project and separate each modules into separate file.

It has got great reporting option to create both rtf and html versions. For the kind of price it is pretty good tool.

Tuesday, January 22, 2008

Script to check OpenDB

I am mostly working on automating all the steps of deployment and testing. Most of the time we face open DB issue. Somewhere in the server, there can be code issue which leads to holding database connection. This happens mainly with the old release codes. This needs to be constantly monitored across the system. The better approach would be poling DB to check no of database connection which is idle for more than specified time (say 1 hour). This is simple in case of Oracle, because this information can be derived from v$session table.

It has to be implemented with some scripting language (like PERL), but decided to use ant because this has been used before. Here is the sample target used,



<target name="db1" if="oracle1.url" >
<!-- Connect to database to find idle connections -->
<echo message="......................... ${db1.name} .........................."/>
<sql
driver="${oracle1.driver}"
url="${oracle1.url}"
userid="${oracle1.user}"
password="${oracle1.password}"
print="yes"
showheaders="false"
showtrailers="false"
onerror="continue"
output="${session.log}"
keepformat="yes"
>
<classpath refid="common.classpath"/><![CDATA[
select rpad(username,15 ,' ')
rpad(MACHINE, 30,' ')
rpad(process,15, ' ')
lpad(last_call_et,15, ' ') ' '
rpad(osuser, 15,' ')
from V$session where
last_call_et > ${oracle1.min.idle.time}
and last_call_et < ${oracle1.max.idle.time}
and username = UPPER('${oracle1.user}')
and (
machine in ( ${oracle1.machine.name} ) OR
osuser in ( ${oracle1.os.user} )
);
]]>
</sql>
</target>


All the parameter can be configured and email the result file session.log

Now this can be set as crontab and run every one hour.