srinivasan ganesan

Ranch Hand
+ Follow
since Mar 09, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by srinivasan ganesan

We have implemented a Stateful Session Beans that uses a HashMap to maintain some state information (info about the client). If the client leaves the site before his session expires and never returns, the info from the cache is never removed and stays there until the garbage collection is run. If the client does come back to finish his/her activity, we clean it up programmatically.
Does anyone have any suggestions as to how to clean up the data (from the clients that do not return) from the cache?

I would like to know if wepshere provides a cleanup service of some sort to take care of this or would we have to write the cleanup service ourselves and run it perhaps once a day..

Thanks,
Srini
I have a program that executes all the test cases in a directory but the execution stops/hangs when an assertion in a test case fails. I use Runtime.exec to run these test cases. Any ideas how I could continue the execution?
15 years ago
If a method returns an Interface, is it possible at runtime to determine what the corresponding class was. For ex. if the signature of the method was a java.util.Collection and it returned an object of type java.util.ArrayList, is it possible to determine that during runtime?

Thanks!!
16 years ago
Does anyone know how to create thread dumps from a java program? This program will call another program that creates some threads and attempt to do a thread dump except I'm not sure how to do it.

Any help would be appreciated.

Thanks,
Srini
Do you know where the thread dump file resides? I thought it would be under \bin\logs but I can't find one there..

Thanks,
Srini
16 years ago
Hello Everyone,
I'm looking for some information on the practical uses (and abuses) of threading in java.
Can someone suggest me books/sites/articles on the best practices of threading?
thanks!!
[ April 14, 2004: Message edited by: srinivasan ganesan ]
I'm trying to implement it using DOM as I speak but there's one little problem I ran into. I want to be able to comment out the portion of second document or not include the set of elements that are commented out in the input
Ex:
XML1.xml
<Element1>
<Child1>
<!--commentedNode1>
<commentedChild1 attr1="value1" attr2="value2">
</commentedNode1>
<CommentedNode2>
<commentedChild2 attr1="value1" attr2="value2">
</CommentedNode2 -->
<UncommentedNode attr1="value1" attr2="valu2 />
</Child1>
</Element1>
XML2.xml
<Element1>
<Child1>
<commentedNode1>
<commentedChild1 attr1="value1" attr2="value2">
</commentedNode1>
<CommentedNode2>
<commentedChild2 attr1="value1" attr2="value2">
</CommentedNode2>
<UncommentedNode attr1="value1" attr2="valu2 />
</Child1>
</Element1>

The output should look like this
XML3.xml
<Element1>
<Child1>
<UncommentedNode attr1="value1" attr2="valu2 />
</Child1>
</Element1>
Do you think I can achieve this using DOM API or should I have write a workaround. I'm not sure how to implement this at this point.
Thanks,
Srinivas
I'm not sure if anyone has done this before but I'd appreciate any suggestions from you.
I have two xml documents. I want to transform the second document using the first document as input. as an ex.
XML1.xml
<ROW num="1">
<EMPNO>7839</EMPNO>
</ROW>

XML2.xml
<ROWSET>
<ROW num="1">
<EMPNO>4235</EMPNO>
<ENAME>BLACK</ENAME>
</ROW>
<ROW num="2">
<EMPNO>4234</EMPNO>
<ENAME>SPARK</ENAME>
</ROW>
</ROWSET>
The transformed document will be
<ROWSET>
<ROW num="1">
<EMPNO>7839</EMPNO>--the value here is from the 1st document
<ENAME>KING</ENAME>
</ROW>
<ROW num="2">
<EMPNO>7788</EMPNO>
<ENAME>SCOTT</ENAME>
</ROW>
</ROWSET>
The first document (input) can contain many elements. I want to search for the occurences of all of them and create the resulting document with the new values.
If you have any questions, let me know.
Thanks in advance,
Srinivas
Could someone help me in achieving this? I need to able to execute a command on the files on the base directory as well as all the files in the subdirectories.
I was only able to do this for the files on the base directory but I'm not sure how to recurse through all the sub directories and execute the same command on the files in the sub directories.
I'd appreciate any help.
Thanks,
Srinivas
16 years ago
The directory structure of the source code that we have in PVCS do not match their package declarations.
I was wondering if anyone knows how to create the directory structure by reading the package declarations..
Here's what I want to do.
I want to get all the files from the project using a specific label and put them in their appropriate directories using the package statements.
I'd appreciate any help..
Thanks,
Srinivas
16 years ago
Mary,
Here's an example
build.xml
<property name="pcli.cmd" value="pcli"/>
<property name="get.cmd" value="run -scheckout.pcli"/>
<property name="pvcs.project" value="YOUR PROJECT DATABASE NAME"/>
<property name="pvcs.workspace" value="WORKSPACE YOU WANT TO USE"/>
<exec executable="${pcli.cmd}">
<arg line="${get.cmd} ${pvcs.project} ${PROJECT_NAME} ${app.version} ${pvcs.workspace} ${DEST_DIR}"/>
</exec>

checkout.pcli:
set -r -vPCLI_IFS "\n\r"
set -vPCLI_PR $1
set -vPCLI_PP $2
set -vVERNO $3
set -vPCLI_SP $4
set -vCHECKOUT_LOC $5
echo Starting checkout.pcli
echo
echo PCLI_PR = $PCLI_PR
echo PCLI_PP = $PCLI_PP
echo PCLI_SP = $PCLI_SP
echo VERNO = $VERNO
echo CHECKOUT_LOC = $CHECKOUT_LOC
if Test "$VERNO"!="0"
{
# The -z takes a path parameter
run -y -xoC:\Output.txt get -q -w -v\$VERNO -pr$PCLI_PR -z $PCLI_PP

}
else {
run -y -xoC:\Output.txt get -q -w -a$CHECKOUT_LOC -pr$PCLI_PR -z $PCLI_PP
}
exit
16 years ago
To whoever is interested in knowing this value for MySql..the datasource-mapping is mySQL (yes its case sensitive). hope this helps someone too..
16 years ago
I need to know if a file is present in a particular UNIX location. I'd like to know what listener I should use to detect the presence of that file from a servlet/jsp.
I'd appreciate any help.
Thanks in advance,
Srinivas
17 years ago
Our app (built using servlets & jsps) runs on an application server. I have a situation where I need to know if a file is present in a particular location. This file is created after the user logs on and it will be posted in a certain location. I'm trying to implement a listener so that I can give the file to the user after it has been created and posted.
Any ideas on how to to achieve this? Also, if you have any questions, please let me know.
Thanks in advance,
Srinivas
17 years ago
Has anyone used the Profiling perspective to profile a servlet for memory leaks. I'd appreciate if anyone has directions on how to do it.
Thanks,
S r i n i
17 years ago