Sireesh Ganagam

Ranch Hand
+ Follow
since May 08, 2012
Merit badge: grant badges
For More
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Sireesh Ganagam

Hello all,

I have questions regarding the multi thread processing using Ant fork approach

Below are the Jar files and associated java classes and methods

Test1.jar has
--Test1.java has
--MethodA()

Test2.jar has
 --Test2.java has
 --MethodB()
 
Test3.jar has
 --Test3.java has
 --MethodC()
 

runtime.classpath will have: Test1.jar,Test2.jar and Test3.jar

testsuite.list: Test1.tsv,Test2.tsv,Test3.tsv


Test1.tsv
-- calls MethodC(), MethodB(), MethodA() in sequence
Test2.tsv
-- calls MethodA(), MethodB(), MethodA()in sequence
Test3.tsv
-- calls MethodB(), MethodA(), MethodA()in sequence

Ant sciprt:



When Ant scripts triggered

Thread 1 pickup Test1.tsv
Thread 2 pickup Test2.tsv
Thread 3 pickup Test3.tsv


Now my question is when 3 threads executing in parallel 3 instances of each Test1.java, Test2.java and Test3.java created ? Or there will be only one instance of Test1.java, Test2.java and Test3.java?

If only once instance of Test1.java, Test2.java and Test3.java created while Thread1 exeucting MethodA() , Thread2 has to wait until Thread1 completes MethodA() execution?

Can some help me to understand this. Also, is there a way I can know how many threads executing given method at a time , is there any locking happening or how many java instances created?

Other point to note is my MethodA(),MethodB(),MethodC() has implementations that’s has wait time and retry mechanism to look for web elements. So I am not sure when multiple threads executing what’s happening .. Sometime I am seeing lot of delay to complete method execution so wondering if there is any locking happening.

Hello all,

when does actually java class loading happens. If i have a ear file with 1000 classes all these classes loaded into JVM while deploying to app server (i.e Jboss) or server start?

if classes loaded where does all loaded classes get stored in JVM ? how it will be in case of dynamic class loading ( using reflection)

Thanks
7 years ago
in the above case

for each instance it has login method ? or for all instances only one login method will be there in java heap?  assume that each login comes from http request.


if at all we want to make as one login method for all login class that will be synchronized?
7 years ago
Let me take an example of a application. let say bank application has user class.


user1 logs in
user2 logs in

and so on .. in this case when each user logs in separate user instance is created or  for all logged in users only one instace will be there? Also for each instace it has login method ? or for all instances only one login method will be there in java heap?  assume that each login comes from http request.



7 years ago



sorry for not being able to explanin clearly

My question is like

let say employee retrieves salary record .. for each employee there is one instance created and employee has salary object.Since employee instance is different multiple instance of salary object is created correct, it is need not to be multi thread? and salary instance has its own getSalary() method?

7 years ago

Thanks so much clarifying this. few more follow up questions.


case 1:

In this it is singe thread ? until instance1 is completed instanc2 will not get called ?


case 2

in this case it becomes multithread instanc2 prints first then instance1?

7 years ago
Hello all,

Can you please help me understand the below class output . what i expected is instance2 instance1 printed. but it is printing as instance1 instance2

as per my understanding here 2 instances of Classic will get created.  first instance has sleep time of  20000 and second instance has sleep time of 5000 millisecond so instance2 get printed as sleep time is less compare to first instance but it is not happening . can you help me to understand?


7 years ago
Sorry if didn't understand correctly. In order to be different container does it mean i have to use different application server instance ( jboss) for each component war , ear , car ? let say if i install war, ear it will become one container .. sorry for the confusion
Thanks for the explanation. how does it matter even if i have the separate war , ear and har files in case using one application server instance ( jboss , websphere)

Hello all,

I have question regarding deployments. we have application code goes into one ear file. but in some scenarios i always hear deploy code in separate container , what it means. why we go for separate container what are the advantages.

appreciate your inputs.

thank
Hello all,

I am going through below link, it sounds like oracle DB automatically detect and resolves dead locks .. how this can be done in java if any deadlock happens?

https://docs.oracle.com/cd/E11882_01/server.112/e40540/consist.htm#CNCPT1336
Hello all,

I am using java 7, what is the default heap allocation if i dont mention?

thanks,
8 years ago
Hello All,

when does actually java class loading happens. If i have a ear file with 1000 classes all these classes loaded into JVM while deploying to app server (i.e Jboss) or server start?

if classes loaded where does all loaded classes get stored in JVM ? how it will be in case of dynamic class loading ( using reflection)

Appreciate your inputs
8 years ago
Hello experts,


I have a scenario where 500 messages are pending in HornetQ messaging queue and not delivered. My application is hosted on java/JBoss/linux and oracle

what is the best way of cleaning pending messages since those messages are already loaded in memory?

Since there are lot of messages in memory and each message is trying to get connection from oracle failing with out of connections errors ? how to handle this scenario?

if at all these pending messages are needed for external system, I can't delete pending the messages .. but how can i deal here avoiding delete and out of connections errors.

Appreciate your inputs