Inesh Hettiarachchi

+ Follow
since Feb 07, 2004
Merit badge: grant badges
For More
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 Inesh Hettiarachchi

Hi rion,

Try this one, it has a lot of info.
google concurrency and go through the java.util.concurrent API
better read and practice a lot before you do your real one, because threading can be tricky to start with.

Dear Chanda,
well come to code ranch.
Synchronized code should be in a common place where multiple threads can access but you have synchronized the addElement method which is in the thread it self and it will be only accessed by the thread itself it is not visible to other threads. This will not prevent from other threads from making a data race on the myList they will store data in the same list position, that's why its actually finishing with lesser than number 49 and 50 elements in the array list.

you can do two things
change myList to a collection from the concurrent API and remove your synchronized key word from the addElement , any way its not synchronizing any thing.
move the addElement to the another class just add it to the ThreadPoolTest.class as a static method or create a singleton class and the method synchronized.
but i prefer the first one.

hope these links will help you.


Cant we use an interface type as a method return type in our web service class


public Vector<InterfaceType> getSelectedObjects()
return objects
if so can you please explain.
Thanks in advance,
15 years ago
you must have the stub generated by the deployment tool to cast the object
and providers give only the stub of the bean deployed .
Cheers .
do not add the jar in the server when you are compiling the client try giving the generated stub when compiling
you can go to the weblogic's administration console and deploy the bean
hope this helps
thanks Ernest for the reply
18 years ago
does try catch blocks effect the performance of a java code
18 years ago
The EJB server provides an environment that supports the execution of applications developed using Enterprise JavaBeans´┐Ż (EJB) components. It manages and coordinates the allocation of resources to the applications. Enterprise beans typically contain the business logic for a J2EE application.

The EJB server must provide one or more EJB containers. An EJB container manages the enterprise beans contained within it. For each enterprise bean, the container is responsible for registering the object, providing a remote interface for the object, creating and destroying object instances, checking security for the object, managing the active state for the object, and coordinating distributed transactions. Optionally, the container can also manage all persistent data within the object.
the ObjectNotFoundException is thorown from a finder method that is declaired to return a single entity.
but the NoSuchEntityException is thrown from business methods or container callback methods (ejbLoad,ejbStore) when the entity is deleted from the database.
i have been preparing for the SCBCD certification and i want to know about certifying as a EJB2 SCBCD is worth while since the java EE is out and there are lot of changers.
i have been looking for a free api to erad or convert pdf to xml but it seems mostof the api are for $$ so i just wanted to know wethe there is any free api or a way i can do it

well it works fine with tomcat weserver
18 years ago
hi all
i am trying to configure jboss with db2 but the problem is i think somthing is wrong it seems the coonnections are not getting relesed
the problem is after getting 20 connections it remains as it is the connection count is not getting lower thann 20 even after 20m

i configured JBossManagedConnectionPool as

BlockingTimeoutMillis 300
IdleTimeoutMinutes 1
Criteria ByContainer

any way the application is working even with the maximum connection level
i just want to reduse the connection count when it is not in use

thanks a lot if anyone can help
18 years ago
thanks a lot it did help me a lot
18 years ago