ejb-3.0

EJB 3.1: Does it allow injection of beans into resources not managed by the container?

﹥>﹥吖頭↗ 提交于 2019-12-01 04:20:15
问题 I am using JBoss 6.1 and its not fully EJB 3.1 compliant. As of now, I can't inject an EJB into my Struts action classes (or in any non-Java EE Container-managed class) via @EJB , but will this be possible when the EJB 3.1 specification is fully implemented? If not, will it be too infeasible to have that due to performance reasons in the foreseeable future? 回答1: No container will ever be able to inject anything into a non-managed object. To be able to to inject into an object, the container

Why use stateful session beans?

烈酒焚心 提交于 2019-12-01 02:54:13
I'm learning EJB3 and I'm just curious when it's convenient to use SFSB? I can't find any nice example when SFSB realy solve easily some complex problem. Actually I see that SLSB can be used as web-services and this is convenient. But I don't know when to use SFSB. I see only problems with it, because we should learn something about it, we should write code which consists of annotations a bit less then completely, we should use annoying lookup ... and we don't get anything good in return. For example, we can't use SFSB from SLSB, because stateful objects can be used only from stateful context.

JPA composite primary key with null value

你。 提交于 2019-12-01 02:53:41
I have a table containing customer data in an oracle database. Here is a simplified definition: CUSTOMER (CUSTOMER_ID NUMBER NOT NULL, SOURCE_SYSTEM VARCHAR2(30), FULL_NAME VARCHAR2(360), PHONE_NUMBER VARCHAR2(240) ) The primary key for this table is (CUSTOMER_ID, SOURCE_SYSTEM) . The table has numerous rows for which SOURCE_SYSTEM is null. At the database level, there is no issue, however when I try to access any of these rows via JPA Entity, it causes a number of issues: 1: Using em.find() to fetch a row with a null SOURCE_SYSTEM always results in a null being returned. 2: Using em.merge()

Injection of EJB3 into Annotation Based JSF2 Backing bean causing javax.naming.NameNotFoundException:

放肆的年华 提交于 2019-12-01 01:03:40
I have seen other thread with similar issue but was not able to work out direct link with my problem . Hopefully I am not repeating a question.My issue is this: I am using Webpsphere 7 with JSF2 as Shared Isolated Library . When I try to inject an EJB3 into in an annotated JSF2 backing bean I get this error Caused by: javax.naming.NameNotFoundException: Name comp/env/helloworld.HelloBean not found in context "java:". but It works fine if we configure JSF2 using face.xml and not use annotation. However without EJB3 injection we can use the application with JSF2 annotations and not see any issue

JPA composite primary key with null value

孤者浪人 提交于 2019-11-30 23:48:52
问题 I have a table containing customer data in an oracle database. Here is a simplified definition: CUSTOMER (CUSTOMER_ID NUMBER NOT NULL, SOURCE_SYSTEM VARCHAR2(30), FULL_NAME VARCHAR2(360), PHONE_NUMBER VARCHAR2(240) ) The primary key for this table is (CUSTOMER_ID, SOURCE_SYSTEM) . The table has numerous rows for which SOURCE_SYSTEM is null. At the database level, there is no issue, however when I try to access any of these rows via JPA Entity, it causes a number of issues: 1: Using em.find()

Why use stateful session beans?

孤者浪人 提交于 2019-11-30 22:56:12
问题 I'm learning EJB3 and I'm just curious when it's convenient to use SFSB? I can't find any nice example when SFSB realy solve easily some complex problem. Actually I see that SLSB can be used as web-services and this is convenient. But I don't know when to use SFSB. I see only problems with it, because we should learn something about it, we should write code which consists of annotations a bit less then completely, we should use annoying lookup ... and we don't get anything good in return. For

Injection of EJB3 into Annotation Based JSF2 Backing bean causing javax.naming.NameNotFoundException:

a 夏天 提交于 2019-11-30 19:58:39
问题 I have seen other thread with similar issue but was not able to work out direct link with my problem . Hopefully I am not repeating a question.My issue is this: I am using Webpsphere 7 with JSF2 as Shared Isolated Library . When I try to inject an EJB3 into in an annotated JSF2 backing bean I get this error Caused by: javax.naming.NameNotFoundException: Name comp/env/helloworld.HelloBean not found in context "java:". but It works fine if we configure JSF2 using face.xml and not use annotation

conversational state of session beans

丶灬走出姿态 提交于 2019-11-30 19:13:30
I'm reading a book on Java EE 6 and I met with the following parts: "Stateless: The session bean contains no conversational state between methods, and any instance can be used for any client." "Stateful: The session bean contains conversational state, which must be retained across methods for a single user." What does "conversational state" mean ? Has somebody real world example to explain it ? Thanks in advance. II. Why this classification of beans so important ? It tells nothing with correct explanation either or for beginner (at first sight ) So thanks to you I got the logical difference,

Using the client jar in EJB 3 and design patterns

落花浮王杯 提交于 2019-11-30 18:01:55
I'm new to EJB 3 and pretty confused with some doubts which Google didn't provide with a satisfactory answer. I'm trying to create a framework with some base classes and some utility methods which my other applications can use. All applications are to be deployed on the same server. When I'm trying to create a new EJB 3.0 project in eclipse, it asks if I want to create a client jar also. What purpose does this client jar serve? My ejbmodule is added as a part of the EAR file. So do I really need this client jar? Do I need to create both local and remote interfaces? Or just remote interfaces

Design Generic CRUD Session Bean

只谈情不闲聊 提交于 2019-11-30 16:06:31
问题 This question has been asked once here EJB 3 Session Bean Design for Simple CRUD, and I just want to ask more in depth questions about this design. I already tried to ask the questions at the original post, however, I did not see any respond, so I decide to create new post. So Pascal solution of implement generic CRUD session bean is as follow public interface GenericCrudService { public <T> T create(T t); public <T> T find(Class<T> type, Object id); public <T> void delete(T t); public <T> T