session-bean

Java EE @TransactionManagement.BEAN - how does it combine with container managed beans?

落花浮王杯 提交于 2021-02-08 04:01:27
问题 How will the transaction started in callSessionBean2() behave in the following scenario? Is it suspended? What happens if an exception is thrown in SessionBean2? SessionBean2 was setup with BEAN transaction management type because it does not communicate with any database, only with AD server via LDAP. I'm asking because I've been having issues in a production server some week after deployment that calls to SessionBean2 starts to hang, with transaction timeouts as the only error. I figured

Java EE @TransactionManagement.BEAN - how does it combine with container managed beans?

半城伤御伤魂 提交于 2021-02-08 04:01:02
问题 How will the transaction started in callSessionBean2() behave in the following scenario? Is it suspended? What happens if an exception is thrown in SessionBean2? SessionBean2 was setup with BEAN transaction management type because it does not communicate with any database, only with AD server via LDAP. I'm asking because I've been having issues in a production server some week after deployment that calls to SessionBean2 starts to hang, with transaction timeouts as the only error. I figured

EJB 3 Session Bean Design for Simple CRUD

可紊 提交于 2020-01-10 08:38:36
问题 I am writing an application that's sole purpose in life is to do CRUD operations for maintaining records in database. There are relationships between some of the tables/entities. Most examples I've seen for creating session beans deals with complex business logic/operations that interact with many entities which I don't have. Since my application is so very basic, what would be the best design for the session bean(s)? I was thinking of having one session bean per entity which had CRUD the

Simple but good pattern for EJB

两盒软妹~` 提交于 2019-12-23 15:34:45
问题 What would you suggest as a good and practical but simple pattern for a solution with: HTML + JSP (as a view/presentation) Servlets (controller, request, session-handling) EJB (persistence, businesslogic) MySQL DB And is it necessary to use an own layer of DAO for persistence? I use JPA to persist objects to my DB. Should I withdraw business logic from my EJB? All online sources tell me different things and confuses me... 回答1: I would definitely put the business logic in Stateless Session

Can't Serialize Session Beans - Warning thrown

萝らか妹 提交于 2019-12-20 05:50:48
问题 I'm running an enviroment with JSF + Primefaces + tomcat 6.0.32 in netbeans using EclipseLink (JPA 2.0). My application works fine, but everytime I run it, I get a lot of warnings saying that cannot Serializate my session beans, and shows me blocks like this for every session bean: 18-jul-2012 23:05:46 org.apache.catalina.session.StandardSession writeObject ADVERTENCIA: No puedo serializar atributo de sesión facturacionController para sesión 62A53325838E1E7C6EB6607B1E7965E6 java.io

Create a stateful session bean from a stateless bean

 ̄綄美尐妖づ 提交于 2019-12-11 07:29:41
问题 The context is the following : An client application uses a stateless session bean in order to login on an EJB server application. If the login is successful, the client should get a stateful session bean in order to perform some transactions on his personal data. However, I would want that the login method returns a new instance of this stateful session bean such that a client should not be able to manually call this session bean and perform transactions without being authenticated. Is it

Spring 3 MVC: Expose session scoped bean in MVC Controller method arguments

我的未来我决定 提交于 2019-12-10 21:03:45
问题 I want to pass a session-scoped domain bean around my controllers for consistency and simplicity - but this doesn't seem possible OOTB. Hope someone can advise. Question: Can a session-scoped bean be exposed as a MVC Controller argument There appears to be an annotation for this: @SessionAttributes("myBean") however this only maintains a Controller-level scope. I'm looking to avoid having to interact with HttpSession and instead pass around my domain object graph consistently through my

What is the preferred way to use EJBs and Servlets for web applications?

一曲冷凌霜 提交于 2019-12-10 09:34:56
问题 I am trying to familiarize myself with JavaEE. I am a bit confused as to what the purpose of each "component" (for lack of a better word) is: Session Beans and Servlets, and how they properly interact with a web application (client-side JavaScript). In an attempt to understand this I am building a simple web application. What is the preferred way to use each component to build something similar to the following: User visits a "Log in" page User inputs data and clicks submit. I then send an

Static variables restriction in session beans

只愿长相守 提交于 2019-12-06 03:03:46
问题 It's impossible to use static variables on a session bean code. Is this restriction arbitrary or fundamented? And why? Best regards 回答1: As stated in the FAQ on EJB restrictions, one of the restrictions for using EJBs is: enterprise beans should not read or write nonfinal static fields Further expanded in the discussion on static fields: Nonfinal static class fields are disallowed in EJBs because such fields make an enterprise bean difficult or impossible to distribute. Static class fields

What is the preferred way to use EJBs and Servlets for web applications?

╄→尐↘猪︶ㄣ 提交于 2019-12-05 15:36:31
I am trying to familiarize myself with JavaEE. I am a bit confused as to what the purpose of each "component" (for lack of a better word) is: Session Beans and Servlets, and how they properly interact with a web application (client-side JavaScript). In an attempt to understand this I am building a simple web application. What is the preferred way to use each component to build something similar to the following: User visits a "Log in" page User inputs data and clicks submit. I then send an request with AJAX to log in the user. The server side then validates the user input and "logs" the user