This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line!
See this thread for details.
Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!

Inesh Hettiarachchi

Greenhorn
+ Follow
since Feb 07, 2004
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 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.

http://www.vogella.com/articles/JavaConcurrency/article.html

Cheers,
Inesh.
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.
or
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.
http://www.youtube.com/watch?v=WTVooKLLVT8
http://www.dzone.com/links/r/2_examples_of_race_condition_in_java.html
http://www.vogella.com/articles/JavaConcurrency/article.html

Cheers,
Inesh
Hi,

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

eg.

public Vector<InterfaceType> getSelectedObjects()
{
//...
return objects
}
if so can you please explain.
Thanks in advance,
inesh.
11 years ago
hi
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
inesh
14 years ago
hi
does try catch blocks effect the performance of a java code
inesh
14 years ago
hi
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.
inesh
hi
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.
inesh
hi
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.
hi
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

inesh
well it works fine with tomcat weserver
15 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
<min-pool-size>5</min-pool-size>
<max-pool-size>20</max-pool-size>
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
15 years ago
thanks a lot it did help me a lot
15 years ago