ejb

why pool stateless bean?

Normally we use singleton instance for business / dao layer. What is the reason behind pooling stateless session beans in case of EJBs? ...

translating outer join SQL query into EJB entity beans

I'm new to EJB and trying to get my head around translating SQL concepts to EJB entity beans. Suppose I have two tables: PEOPLE (id, name), CONTACT(pid, phone_number). If I want to get a list of all people whether or not they have phone #s, in my EJB session bean I simply issue a SQL query via JDBC such as: SELECT PEOPLE.name, CONT...

Maximum number of messages sent to a Queue in OpenMQ ?

I am currently using Glassfish v2.1 and I have set up a queue to send and receive messages from with Sesion beans and MDBs respectively. However, I have noticed that I can send only a maximum of 1000 messages to the queue. Is there any reason why I cannot send more than 1000 messages to the queue? I do have a "developer" profile setup fo...

Help me out in learning EJB

I am gonna start learning EJB. I just need your suggestion on picking the version for learning EJB 2.0 or EJB 3.0. Is it good idea to start with EJB 2.0 and migrate to EJB 3.0? If it is, can it be easy to migrate? Actually I am holding Head First EJB book covering version 2.0. Suggest me any other good book, that I can stick to it for co...

How to call an EJB method when it deploys itself?

Hello, I want to call to a method from an EJB in the same instant in which one deploys itself, without using a servlet. Thanks. David. ...

what is counterpart for ejb in dot net?

hey i have to migrate a project written in java 1.4 with ejb 2.0 to dot net 3.5 in c#.What i counter part for ejb model in dot net framework? ...

Why make an EJB rather than a Web Service?

I would have thought that there is a lot of information out there on this, but I haven't found anything that really answers my question. What are the advantages of making an EJB rather than a web service? The only clear advantage I can come up with is performance. Even so, I can't find any hard data on how much more efficient EJBs are. ...

JBoss MQ tutorial

I'm looking for a JBoss MQ tutorial (on JBoss Tools) so that I can write an MDB and a client. I can find only JBoss Messaging. ...

Java EJB interface

Hello, I have been working through this tutorial. Halfway though it creates an interface and facades for an EJB. Can anyone tell me when I reference the interface using the @EJB annotation, where does it actually make the link between the interface and the actual enterprise java bean itself. Thanks for the help. ~ Kyle. ...

Spring best practice for locking domain objects?

Using EJB entity beans you can configure the bean so that when a thread has access to an EJB entity bean, no other threads can access the EJB bean. The container will block other threads until the thread with the lock is finished with the bean. Is there a "Spring way" to do this? Or do you have to just use the standard Java concurrenc...

does ejb commits on connection?

i am using session bean in my application and transaction is controlled at EJB layer only. The problem that i am facing is with some commit. I am using the same connection as used by EJB to insert into one table, but if the transaction is committed then that insert is not committed into the database.. can any one help me with the problem...

What does a stateless session bean provide over just a normal class?

What would a stateless session bean provide over just a regular class that has the same methods? It seems that a stateful session bean can be distributed out of the box and the container will make sure that the state looks the same to clients anywhere. With a stateless session bean what is provided that you would not get with a normal ...

Explicitly destroying EJB instance on glassfish

How do I explicitly destroy an EJB instance in code and take it out of circulation? I have an ejb class that becomes unusable after it throws a certain exception. After that I need to remove it from the app servers pool of instances. ...

Correct usage of Stateful Beans with Servlets

We currently have a Stateful bean that is injected into a Servlet. The problem is that sometimes we get a Caused by: javax.ejb.ConcurrentAccessException: SessionBean is executing another request. [session-key: 7d90c02200a81f-752fe1cd-1] when executing a method on the stateful bean. public class NewServlet extends HttpServlet { @EJ...

How to get SessionContext in JBOSS

I tried several ways in the session bean, like: @Resource private SessionContext ctx; OR private SessionContext ctx; @Resource private void setSessionContext(SessionContext ctx) { this.sctx = ctx; } OR InitialContext ic = new InitialContext(); SessionContext ctx = (SessionContext) ic.lookup("java:comp/env/sessionContext"); No...

EJB / Resource injection references - passing to Pojo's

In JBoss 4.x, @EJB / @Resource annotations can only be used in EJBs. If you use a stateless bean or an MDB as an entry point, you can inject your resources using the annotations. However, if you have Pojo's that perform business logic and need to use these resources, they can not be injected via annotations. I am passing the reference...

How is that instance pooling with EJBs can improve performance?

How is that instance pooling with EJBs can improve performance? Wouldn't you be able to accomplish the same performance just with threads like a java servlet? Or perhaps instance pooling with EJBs happens for another reason? ...

help me in Stateful beans

Question 1: As per the book I follow to learn EJB author told that every lookup creates a new stateful session bean. So, what I did is defined a method init() with @PostConstruct annotation with a sysout statement. So, that need to be executed for every Stateful bean instantiated. But the same is not happening. Consider the following cod...

using spring with ejb

Hi have you used spring and EJB together in a project? It it's good or not. And how, what you used spring and EJB for? thanks ...

JBoss RMI Transaction

Hi, How can i can achieve remote transaction while using Remote EJB (over RMI/IIOP or RMI/JRMP). Is that JBoss 4.0 support this kind of transaction or should i use jotm or atomikos? Thanks in advance ...