paresh vernekar

Ranch Hand
+ Follow
since Jul 10, 2006
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 paresh vernekar

Thanks Bear, I agree with what you say...Let's see if I get some answers from the Websphere experts


Paresh Vernekar
11 years ago
Hi All,

I am running into a peculiar situation in the production environment. I have a web-based application running on IBM Websphere Application server (v6.1). At startup, I have a servlet which loads 4 specific objects (different classes) and stores them into the ServletContext.

The problem is that in past few days one of the object from the ServletContext is getting lost. This object is used in several JSP for creating a drop-down.Since this object is lost the drop down list is not created.
At each occurrence the same object is getting lost. This object is nothing but an array of a simple bean

As far as I know, the only time that ServletContext will lose data is when the application is shutdown.
Since this is happening only in production its difficult to track down the issue in Dev environment.

Have any of you come across such a situation?

Thanks,
Paresh Vernekar


11 years ago
Going through the specs would help you get the fundamentals correctly. This would help you get past some tricky questions.Mock tests, writing lots of code, reading different books and of course following the forums are definitely required for sailing through the certification tests
It would depend on the object instance that you as the lock for the synchronize block within your method.If the same instance is used, then in that case if one thread is executing within that synchronized code then another thread will not be able to execute a synchronized block within another method using the same lock
It doesn't look like the program written is the right way to demonstrate what you are trying to test. The main program is creating two thread instances.Each thread instance has its own instance variables. And hence, you are not seeing the expected result w.r.t instance variable x.

You could create another class TestThread with instance variable x and pass the same instance it to each of the threads. Do the operations on that instance of TestThread and you would see your queries answered

Thanks,
Paresh

Ulf and Mark,

If I understand correctly, what you guys are saying, even if a static initialization block is complete there may be other threads trying to access the map
My understanding is that the code in the static block would be executed at class load time and hence would have been completed (assuming there are no exceptions) when the webapp is loaded in the container and before any report requests have been received.

Hence, there may not be any need to protect access to the static block using the Lock...
Do let me know if I am missing something.

However, the suggestion of using the listener with a web-app seems to be a better approach as compared to using static block

Thanks,
Paresh
HI,
Local interfaces donot support location transparency.It is the remote interfaces that do so.You need to know the JNDI name and the IP.The IP is address of the naming server not of the bean.The EJB application maybe deployed at some other point in the network and the beans maybe configured using JNDI to the naming server.This is the IP that you need to.
Regards,
Paresh Vernekar
HI Cheenu I didn't get your question.What do you mean by without transation?
Hi,
These three can be used with a session bean if required.
I think one issue in passivating a stateful session bean is that since it is associated with a single client, the state should be maintained across method calls.In case of an open transaction spanning multiple methods if the bean instance would have been passivated then there would be unnecessary overhead of restoring the state between method calls. In case of entity beans since they are not associated with a single client passivating an instance in a transaction would not be a problem.On a method call, if the previous instance has been passivated, the container can associate a new bean instance and load it with the data
HI Amit,
Although the spec doesn't mention that the ejbHome methods shouldn't be final, however this doesn't work.I tried the same but the appserver didn't deploy the application.I used Weblogic v8.1.It used to give error at deploy time

Regards,
Paresh Vernekar
Wow!! Thats a fantastic score.Heartiest congratulations !!!

Regards,
Paresh Vernekar
14 years ago
Heartiest congratulations!!!
14 years ago
HI Chandru,
Has your problem been solved?


I think when you do a lookup you should use the following:
context.lookup("java:comp/env/ejb/MyEJB")

Let me know if this solves your problem

Regards,
Paresh Vernekar