Q
Problem solve Get help with specific problems with your technologies, process and projects.

Can I save a Session Bean open as a socket?

Hi. Can I save a Session Bean open as a socket? Is my understanding correct: you can't have your own threads in EJB's. Thread mgmt is taken care of by container. It is prohibited to have own threads in EJBs.

It is true that you cannot have your own threads. Your only concern as far as threads is making sure that your beans are to spec and will not have any synchronization problems. For example, you are not allowed to have a read/write static field.

As for sockets, you're ok. The EJB 2.0 spec says, "the EJB architecture allows an enterprise bean instance to be a network socket client, but it does not allow it to be a network server." (24.1.2: Programming restrictions).


Dig Deeper on Topics Archive

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchSoftwareQuality

SearchAWS

SearchCloudComputing

TheServerSide.com

Close