Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Ganesh.P Ram

Ranch Hand
+ Follow
since Dec 22, 2005
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 Ganesh.P Ram

Hi Henry,

As per my understanding also, the thread does not get the lock on the object which has the called method.
But the book seems to convey (pls read my quote) that, the thread has a lock on the other object.
That is what is confusing me !!!
class A{

public void foo(){
sync (this){
bar(); // calls bar() that is not sync
}
}

public void bar(){
// not syncronised.

}
}

Suppose i have a sync block in foo(). That in turn calls bar() which is not syncnorised.
Page 35 (Chapter 9)of Kathy Siera says -

When a thread is executing code from within a synchronized block, including any method code invoked from that synchronized block, the code is said to be executing in a synchronized context.


Now if any other thread wants to access this bar(), does it have to wait until any previous thread's lock is released ??
The exam code is 310-090 ???
Just wanted to confirm before I book the slot.

Thanks in advance,
Hi Saeed,

When the ejbPassivate() of your SFSB is called, then all the transient instances should be in one of the states that is mentioned in HFEJB (like null,Serializable object and so on..pls refer to HFEJB for the complete list.)

The jdbc Connection object is not serializable.
So in your ejbPassivate(), you will have to explicitly assign it to null (to meet the above said condition).

In your ejbActivate(), you will have to get back the connection explicitly.
All the serializable attributes will get back their previous state. You dont have to bother abt that.

Hope this answers your question.
Hi ppl,

Sorry, I really messed up with my abbreviations in my last post.
What I meant was - is there a pool for the SFSB (ya..Stateful Session Bean !!!).

This is the correct question -

Am really confused as to whether there is a pool for SFSB like SLSB pool.

HFEJB says that - when ever the client calls the create(), then a new SFSB bean and EJBObject is created, bean is associated with EJBObject and EJBObject stub is returned to the client.

As per EdRoman - there is a pool for SFSB also. If there are not enough beans available, then Least Recently Used (LRU) bean from the pool is passivated, and the client is given an already existing SFSB bean from the pool.

I was under the impression that for every client a new SFSB is created.
But Ed Roman (and my Tech Lead !!!) seems to suggest that existing beans from the pools can be used. Their point is - you cannot keep creating new beans for every user. There wud be a max limit on the number of SFSB that is created. E.g. if there are 2 beans and 4 users, then first 2 users get the beans. Then when the 3rd user requests for the bean, then LRU Bean is passivated, and the existing bean is sent to the client.

btw..one more question here...

During passivation, is the bean passivated (or) are the contents of the bean passivated ? As per my understanding, HFEJB says the bean is passivated and EdRoman suggests that the contents of the bean are passivated. Thats why the same SFSB bean can be allocated to multiple clients.


Sorry for the extremly long question.
Hi,

Assume i login into a Shopping Cart appl and add an item to my cart.

In the code when home.create(String userId) would be called, the SFSB bean and the EJBObject would be created. (For SFSB, the create() can take args !!!). The ejbCreate(String userId) in the bean would be called. It might have some code like - this.userId = userId. This associates the bean with the user, right ???
My item would be added to an arraylist in the bean class.

When I add another item to my cart, then would the home.create(String userId)be called again ? Then it would check for the userId attribute in the existing Bean classes, and find out that the bean is already created, and use the existing bean.

Is this how it works ???

Or, is it sth like, when the user logs in (or at some later point of time), a SFSB is associated for him. And we use that bean for all the items that he adds to the cart.

Please clarify.
Hi ppl,

Am really confused as to whether there is a pool for SLSB like SFSB pool.

HFEJB says that - when ever the client calls the create(), then a new bean and EJBObject is created, bean is associated with EJBObject and EJBObject stub is returned to the client.

As per EdRoman - there is a pool for SLSB also. If there are not enough beans available, then Least Recently Used (LRU) bean from the pool is passivated, and the client is given an already existing bean from the pool.

I was under the impression that for every client a new bean is created.
But Ed Roman seems to suggest that existing beans from the pools can be used. I can appreciate the fact that there would be constraints on the number of beans that is created. But not sure if pool exists.

Please clarify.
Hi,
Iam facing a problem while deploying an EAR on a weblogic cluster.

javax.naming.NoPermissionException: User <anonymous> does not have permission on weblogic.management.home to perform lookup operation.

I have enabled the "Anonymouse Admin Lookup" option.

If i deploy the EAR in the admin server, then it deploys fine.

But if iam deploying an EAR in a weblogic cluster, i get the above error.

Some body please help.
14 years ago
Hai,
Dont be worried abt that.
Just forget it and give the exam ur full shot.
In one of the j2eecertificate mock exam, i only got 2/20 right (ie 10%).
But I scored 89% in the final exam.

All the best...
Hi Santosh,

U should be able to manage by reading HFSJ and the Specs.
Wud say SCWCD Study kit is optional - but some of the chapters are gud.

Also remember to go through Bryan's Notes on Dynamic Attributes.
For APIs, u can use fredric's notes - it contains all the imp apis that we need to know for the exam.

Hope this helps,
I have a req to cache the frequently used objects in my project.
Could any body suggest any useful links / suggestions for this.

One of my friends was telling me that OsCache is good. Any comments on that.


Thanks in Advance,
Hi Shameen,
I was referring to SCWCD Study kit by Hanumant Deshmukh.
Hi folks,

I understand that SCJP is mandatory for writing SCWCD.
But when I booked the slot or wrote the exam yesterday, no body asked me If I was SCJP certified.
How does SUN find that out if some one has cleard the pre-requiste or not ??
Hi folks,

Have cleared the SCWCD with 89%.
Special thanks to the authors of HFSJ - the book was wonderful and had a nice time reading it.
Also a special note of thanks to Fredrick for his notes.
I had taken a print out of his notes and when ever i found any thing new, just kept adding to his notes.
Would also like the thank the JavaRanch community.

I had also prepared a list of all the entries that go into the web.xml bcos the exam expects us to know those entries.
Also referred to the specs some times.
SCWCD study kit is also good, but not as good as HFSJ.
Taking a few mock exams will be useful...

I had taken a week off from office for preparing for the exam !!!
Hoping to see u all soon in SCWCD forum !!!
Any guesses as to why HttpServet class is abstract ?
None of the methods in the class are abstract. So why is the class abstract.
Is it bcos we shudnt instantiate the class ?