Jonah Kommu

Greenhorn
+ Follow
since Mar 09, 2011
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
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jonah Kommu

Thank You for response.

I did check the file before selecting it.
Do the providers listed in the file come standard? Are they packed in a specific JAR that could be missing in my classpath?

TIA !!!
12 years ago


I am having problem at cipher = Cipher.getInstance("Blowfish","SunJCE");
unfortunately, The logging FWork is not printing anything from this line onwards.
This code works on my local machine...
Not sure if the if the environment settings (on the target) being different could be an issue?
Target env. has JDK 1.5
Do some providers come standard with JDK.
Are there any jars that could be missing on the target env. ?

TIA !!!
12 years ago

Or when within an application server that is configured to have a pool of connections, on a getConnection would the connection returned is one of the pooled connections?

thanks in advance !!
How do I know that the application that I am working on uses a connection from the pool of db connection that the application server has created rather than creating a new one?

In the DAO's should I be looking for certain explicit methods?

TIA!

hese annotations will be first processed by a program called annotation processor that can read a Java program and take actions based on its annotations.



Thanks again.
So what ALL actions would have been taken in your example below..?

-- any objects boilerplate objects get created
-- any JNDI mapping that was done

This metadata is used by the IDE, compiler and JVM (depending upon scope\retaintion policy of annotation) to extract additional information about class and attributes.



Thanks for the response.
But would you be able to summarize how they are utilized and as to what the output is? Taking an example of a session bean.
Just started reading about the changes 3.x brings. And there might be questions that already explain this on the forum.
What all do annotations do under the hood for me. I assume they generate the boiler plate code (remote, home objects etc)

TIA !
J

Mike Simmons wrote:I'd say it's achieved by virtue of the fact that nothing prevents it from happening. In general, threads can execute any code you tell them to.

Did you mean to ask how synchronized blocks or locks can be reentrant? That's a different meaning of reentrant than the one you gave.



Actually I want to know what happens under the hood to a Java method at runtime.
what exactly resides on the heap for a method..?

And if this method is concurrently run by multiple threads how does the JVM/ processor handle it. (considering the method is not synchronized.)

TIA !
13 years ago
All Java methods are reentrant. It means several threads can be executing the same code at once.

How is this achieved? assuming all this happens at the byte code level.

Thanks in advance.
13 years ago

Pat Farrell wrote:Since its widely known that "Singletons considered dangerous", why are you having 1000 threads beat on a singleton? Perhaps one can argue that a singleton is acceptable for near-constant data, but why are you calling methods in the singleton?

There are far better patterns to use than a singleton, such as a factory that only creates one instance.



Actually we are using Factory that creates one instance. (And I assume my referring it as a singleton is wrong??)

And within the one instance object's method, static variables are not referred and only local variables are being used.
So I think we are good.

Also would you please explain what you meant
There are far better patterns to use than a singleton, such as a factory that only creates one instance

T.I.A
13 years ago
Thanks for your quick reply.

Yes there are 1000 threads calling the method (that is within a singleton) at the same time.
But singleton being only one instance in memory, wouldn't 1000 threads get queued for the access ?

Do let me know if my question is not clear.

Thanks
13 years ago
Say there is a method in my singleton.
And, from my handler there are invocations to this method.

my question is if there are 1000 concurrent hits to the singleton method, how is the situation handled, singleton being only one instance in the memory?

- will the 1000 requests queued to be handled in sequence by the JVM
- or will the virtual machine spawn 1000 threads

Thank You for your response.
13 years ago