ejb-3.0

Change the way Entity Bean values are viewed by using own annotations.

We have tables with legacy columns where SpecialStrings are stored. These SpecialStrings can't be NULL and they instead equal to some SPECIAL_UNICODE_NULL. So to send an entity back to a client via JAX-WS we have to either implement the whole Entity wrapper for sending it instead of Entity or to add convert logic explicitly to Entity ge...

Java EE example project

Hello! I am currently in the process of learing about Java EE, EJB3 and . So far I am running a JBoss application server and a Oracle database. I have written a stateful session bean which retrieves data from the database through JPA entities. My goal is to have a simple client speaking to a server by calling methods in a stateful bea...

Is using data transfer objects in ejb3 considered best practice

Although obviously not all scenarios can be covered by a single design, is it generally felt now that ORM classes should be passed to and fro between the presentation and business layer (either local or remote), replacing the need for data transfer objects? As far as I can see, using ORM classes presents problems of unnecessary eager loa...

Best practice for EJB remote interface wrapping entitys

I currently have the excercise at university to create several Java-entitys (Person, Employee, Department, DepartmentType, ...) handled by JPA which should be accessed by the client through some EJBs (I think that's best practice?!). Now I think about how to organize/design the EJBs. Do you create one EJB per Entity? Or one EJB for all...

TimerService EJB 3

Hi, Related to TimerService, can I define two Timer instances and bind each timer to a specific (different) method annotated @Timeout in the same EJB? Thanks, Rod ...

EJB calling another EJB method

I am more curious about whether this is a best practice or should be avoided. Say I have two EJBS that each work with a different type of object, a widget and a foo. The EJB that manages widgets needs to get a collection of foos to do some processing. This functionality is already created in the FooManager bean. The method in the Widget...

To EJB3 or not?

I have an architecture scenario and I would like to discuss to get your opinion. I can choose between these two (this is a constraint imposed on me) Use EJB3+JPA - no Spring/Hibernate POJO + JDBC - again no Spring/Hibernate I have series of web applications (only intranet) that all need to be integrated. At database level, there wi...

How to execute bulk delete with relationship in EJB3

I am trying to figure out how to execute a bulk delete on a @ManyToOne relationship without success. Scenario: Parent has many Downloads I want to execute a delete of all Downloads where the Parent date is > :some_date. I do not want to delete any of the Parent records, just the Download records. Download has a parent field that i...

java ejb3 @PostConstruct

Hello there, I am experimenting with EJB3 on JBoss, developing a stateless bean. Basically once the module has been deployed I need to perform some actions related to load application settings. To do this I've annotated a method as @PostConstruct, which as far as I know from the API instructs the container to invoke it once the bean has ...

Different connection pools for read / write access

An EJB3 stateless session bean exposing CRUD operations for an entity bean will contain read / write methods which go against a single connection pool. If you would like to have your read & write operations go against different databases for scalability purposes, how do you accomplish this at the code level. Any pointers to appropriate d...

Keeping state with remote EJBs and Web Services

I have a web-based application which makes use of remote EJBs for its business logic. Some of these EJBs are also exposed as Web Services. I need to keep a small state for some of these calls in order to allow subsequent calls to function correctly. Which of the following would you recommend? Stateful EJBs (will this work with Web Serv...

How to keep Mysql high availability while column datatype & value are changed?

Hi, I am looking for a strategy to keep mysql and web service high availability while changing column datatype and value. The scenario is: for example, a student table has columns student id(Integer), student name (vachar) and rank percentage (Integer). The integer value in rank percentage is the percentage integer number, for example,...

Db migrate - Hibernate/JPA - hbm2ddl - diff tools...

Hello I use - EJB3 / JPA (hibernate) - MySQL 5 I have to set up a system to help database migrations. Tried to use LiquiBase but it seems not enough mature yet to be used with Hibernate. What i would like to do is: - I have version 1.0 of the application in production - I have version 2.0 of the application developped and tested - I ...

Calling EJB3 from a Faces BackingBean

I have a simple web application, packed as an EAR, deployed on Glassfish. The EAR has a web module and an EJB module. The web module has a faces page, and a ManagedBean. The Faces page only has a button on it, and the button is tied to a method in the ManagedBean, and clicking the button does indeed fire the method. The managed bean: p...

Toplink & java storing word or pdf files

I'm creating a simple page with a form. Part of the form requires uploading a pdf or word document. This will be a small file, so ideally I would like to store it in my oracle database. I'm using ejb and toplink for all of my persistence. What object should my entity class have that will hold a word or pdf file, and how do I map it to ...

EJB3 - Session Bean calling method of another bean interface

I have a little question... I search the difference in local access between accessing a method that is only declared in the remote interface of a bean and not in the local interface... does the interface declaration (remote or local) determine the access protocol of the method? or does the ejb container understand that both beans are ru...

Retrying container managed transactions from an EJB on JBoss AS

Hi, I am attempting to retry a container managed transaction from an EJB, in JBoss. I have tried creating a retry handler and I am currently getting the below error. 11:35:02,765 INFO [EARDeployer] Init J2EE application: file:/E:/Jboss/jboss-4.2.2.GA/server/default/deploy/RetryTest.ear 11:35:02,984 WARN [ServiceController] Problem cr...

JPA Entity mapping with no foreign keys available

Hi, I dont really get to work with entity beans, but they are staring at me right now. We have a couple of tables that are related to each other, but there are no foreign keys, and we cannot add any. For this question, the database cannot change, it's just not possible, but as a different solution we might create views. Anyways... I...

JBoss/EJB - location of custom configuration file

I'm implementing an EJB-based system in JBoss. One of my message driven beans will be responsible for sending emails. I want the email template to be stored externally (probably as XML) so that it can easily be changed without having to change the code/redeploy the bean, etc. Where should this file be placed and how do I reference it?...

EJB does not deploy properly in Eclipse Galileo and JBoss

Hello, I am using eclipse 3.5 with JBoss inside. There is one project that we are currently working on. The problem is that when I deploy the project it reports an exception: org.jboss.deployers.spi.DeploymentException: Exception determining structure: AbstractVFSDeployment(EAR.ear) with a nested exception: java.lang.RuntimeExcept...