Eric Pramono

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

Recent posts by Eric Pramono

I'm a little bit confused.

According to the Servlet 2.4 spec, SRV 7.7.2 page 60, the process of session migration will be handled by container-specific facilities. While according to HFS&J book, there is a certain level of assurance that the session is not replicated, and that each request will "somehow" try to find which VM is holding its session.

OTOH, according to this implementation by Tomcat/WADI
Tomcat Clustering How-To
WADI - Frequenty Asked Questions
the session is actually being replicated.

I can't find any implementation information by WebLogic, OC4J or Websphere. I'm assuming that JBoss uses the same implementation as Tomcat & WADI.
Which one is the correct behavior? Is HFS&J wrong? Is HFS&J making its own assumption on how the implementation would be like, based on the Servlet 2.4 spec? Is Tomcat/WADI implementation also a valid Servlet 2.4 spec implementation?

- eric
Is there any chance that Sun will no longer offer the SCJP 1.2 and/or SCJP 1.4 within the next couple of months?
Is there anywhere on the web showing Sun's policy on this?

- eric
I just checked to this link

Does this mean taking SCJP 1.2/1.4 is a bad move?

- eric
Thank you Elisabeth,

I'll try to read the sample chapter tonight, and hopefully I can come back later to ask more questions.
Thank you again,

- eric
Hi Bert & Elisabeth,

Does your book discuss other Design Patterns other than the ones found in GoF book? What kind of approach does your book have in explaining each of the Design Patterns? I'm actually looking for a book which might help me find what pattern to use when facing a design problem, or when refactoring an existing code, especially with the more "not-so-obvious" patterns.

Do you have a link of the table of contents or sample chapter for us to take a brief look?

Thank you,

- eric
Hi Ben,

I'm curious into what you might want to do with the thread there?
Are you initiating the thread from a Session Bean or an Entity Bean?
Even though it's technically possible to do so, but why would you do so?
Could you give me a sample case where initiating a thread from a Session Bean or an Entity Bean may just solve a problem?

Just out of my curiosity..

- eric
Hi Karthikeyan,

If you need to access a new method (I assume this is a public method) in a SLSB, I don't think you need to perform the inheritance, unless there's another thing you want from the inheritance. SLSB is similar to a utility class where all its public methods can act on their own regardless of the other public method existence.

My initial suggestion, assuming you need no further advantage from the inheritance, would be to create your method in another SLSB which is totally different, and which does not require any relationship with your previous SLSB.

BTW, just as an additional information, extending an SLSB is rather tricky. Here's an example what needs to be done:
1. Create a new Object interface which extends your super SLSB's Object interface
2. Create a new Home interface which consists of create method of your new bean
3. Create a new Session Bean implementation which extends your super SLSB.
4. In your new SLSB's ejbCreate() method, invoke your super SLSB's ejbCreate() method to provide consistency with your previous callback implementation

And I believe there's still plenty of things to watch out for..
Therefore I'd like to stay away from it, unless I really really have to go that way..

- eric
Hi Prakash,

The statement would be correct if we're talking about classes other than the Object class. But, when we're talking about the Object class, the implementation of the hashCode() method in the Object class will return the unique memory address which was allocated to store the object created.

Hence, we can always be certain that when two objects are created differently, they will have different memory address assigned to them, as well as different hashCode() value (if they're using the hashCode() method implementation in the Object class).

- eric
Hi Mathangi,

As Joyce explained, the StringBuffer class also does not override the hashCode() method implementation of the Object class. Hence, when the hashCode() method is invoked on a StringBuffer instance, the hashCode() method in the Object class is invoked instead.

Please refer to your Javadoc, Object.hashCode() for more details on the equals() & hashCode() contract..

- eric
Hi Prakash,

StringBuffer class does not override the equals() method, thus invoking the equals() method on a StringBuffer object will invoke the equals() method in the Object class. Since s1 and s2 are two different StringBuffer objects, the equals() method in the Object class will return false.

- eric
Based on the API, I think that ArrayList, LinkedList & Vector have the listIterator() method which allows them to return a ListIterator representation of the collection data.
The ListIterator interface methods are the ones that actually allow the data to read in reversed order (using previous() method).
BTW, is this a part of the 1.4 exam?
- eric
This is from Sun JDK1.4.1_01 implementation for Win2K:

If we're studying for the exam, which should we refer to? The API? 'Cause I've looked for this in JLS, and I can't seem to find one..
- eric
Hi guys,
It's been a while for me since my last visit here on Java Ranch.. ^_^
Anyway.. can anyone please help me to point me to some resources on the net, on how to create thumbnail from bitmap images.
I don't seem to have problems with creating thumbnail from jpg, jpeg or gif.
But bmp has given me some problems.
Please let me know if anyone can help.
Thank you in advance.
- eric
ps. please redirect me to a more suitable forum for the question if this forum is not.. ^_^
19 years ago
I have a question that I need to figure out..
Can Entity Bean synchronize the data when it's being put across multiple application server with no clustering?
An example would be like this..
I have two application server containing the same exact Entity Bean viewing the same row in a table in one database. Then, illustrate the following sequence:
1. Entity Bean A reads the Data (say, equals to 13)
2. Entity Bean B reads the Data as well (13)
3. Then, B updates the Data to 17
The question is:
1. Would Entity Bean A know about the Data being updated to 17?
2. Is it allowed for the Entity Bean A to update the Data (which is invalid) to say, 16..? If it's allowed, then what happened with B? He wouldn't know if his update really means nothing..
Please let me know what you think, guys..
Since, I'm also a beginner in this J2EE..
Please remember that the environment consists of 2 application server and 1 database, and the Entity Bean lies across application server, and that we don't have any clustering (we use our own session manager to manage the session through database)..
Please let me know..
Thank you..
- eric
Hi all,
I just found in JLS this example

Now, the JLS says that it's perfectly fine to forward reference both x and j. But, I compile it with jdk1.2.2 and it doesn't say so..
Could anyone please enlighten me?
Thanks in advance..
- eric