question about EJB and thread safe coding - asking again!

sorry everyone, no one seems to be interested in helping me on this, so i post it again.

i have a question about the EJB and thread safe coding. when we build EJBs, do we need to worry about thread safe issue? i know that EJBs are single threaded, and the container manages the thread for us. maybe i am wrong about this. if i wasnot, how can we program the EJB so that two or more instance of EJB are not going to have deadlock problem when accessing data resources. do we need to put syncronization in ours beans, do we even need to worry about creating a thread safe EJB? thanks in advance. the question really bothers me a lot lately.

[652 byte] By [yu169409] at [2007-9-30 22:32:53]
# 1

> sorry everyone, no one seems to be interested in

> helping me on this, so i post it again.

Excellent plan. Why not search a little bit on your own instead of waiting for your personal forum slaves to answer your call. See below.

> i have a question about the EJB and thread safe

> coding. when we build EJBs, do we need to worry about

> thread safe issue?

Read this: http://forum.java.sun.com/thread.jsp?forum=13&thread=562598&tstart=75&trange=15

> i know that EJBs are single

> threaded, and the container manages the thread for us.

> maybe i am wrong about this. if i wasnot, how can we

> program the EJB so that two or more instance of EJB

> are not going to have deadlock problem when accessing

> data resources. do we need to put syncronization in

> ours beans, do we even need to worry about creating a

> thread safe EJB? thanks in advance. the question

> really bothers me a lot lately.

[url=http://java.sun.com/docs/books/tutorial/essential/threads/]Java's Thread Tutorial[/url]

[url=http://www.javaworld.com/javaworld/jw-04-1996/jw-04-threads.html]JavaWorld: Introduction to Java threads[/url]

[url=http://www-106.ibm.com/developerworks/edu/j-dw-javathread-i.html]IBM: Introduction to Java threads[/url]

[url=http://www.google.com/search?q=java+threads+tutorial&sourceid=opera&num=0&ie=utf-8&oe=utf-8]Google: java+threads+tutorial[/url]

yawmark at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...
# 2
Hi,Read the EJB specifiaction. You aren't allowed to use synchronization within EJBs. You should never create threads on your own, or try to guard resources within an EJB, the container does that for you./Kaj
kajbj at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...
# 3

> Excellent plan. Why not search a little bit on your

> own instead of waiting for your personal forum slaves

> to answer your call. See below.

i am sorry you feel that way. i personally appreciate the wisdom of experienced experts. sometime i find it is easier to understand concepts when chatting with people instead of reading some articles. but i will definitly do more search on my own.

yu169409 at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...
# 4

> i am sorry you feel that way. i personally appreciate

> the wisdom of experienced experts. sometime i find it

> is easier to understand concepts when chatting with

> people instead of reading some articles. but i will

> definitly do more search on my own.

then seek out mentors in your company. join a java group in your community. nickel & diming the forums won't get it done.

fredsanford at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...
# 5
> but i will> definitly do more search on my own.That's good, but you have already been given the answer to this question :)/Kaj
kajbj at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...
# 6
> > Excellent plan. Why not search a little bit on your> > own instead of waiting for your personal forum> slaves> > to answer your call. See below.> > i am sorry you feel that way.No need to be sorry.
yawmark at 2007-7-7 12:56:13 > top of Java-index,Java Essentials,Java Programming...