Persist « ejb « Java Enterprise Q&A

1. How to use non-key composite elements in EJB3?

Using EJB3/JBoss, how can I use a composite element from a table, e.g.

public class X {
   private int id;
   private Coordinate coordinate;
where Coordinate is ...

2. What is the need of a Custom Persistence Framework in Java?

We have a custom Persistence Framework wrapping the Entity Beans. I want to know why is this required or does it have any performance improvement when we already have Entity Beans ...

3. javax.persistence.NoResultException: getSingleResult() did not retrieve any entities

i have created a namedquery with ejb to check if the username is used. When the singleResult is null, then i get the following Exception :

javax.persistence.NoResultException: getSingleResult() did not retrieve any entities
But ...

4. EJB3 + JEE6: What is a persistent Timer?

I'm just about to use the new EJB3 TimerService (as part of Java EE 6), and as usual, I'm impressed by the brevity of JavaDoc :) Do you know what is the ...

5. Trouble deploying EJB application to JBoss when implementing persistence

I'm trying to implement EJB persistence, but I'm having trouble deploying my application to JBoss. In my application I have the session bean TeamMgr, which looks like this:

package ejb;

import javax.ejb.Local;
import javax.ejb.Remote;
import ...

6. when is an EJB CMP entity bean actually created

I have a session bean that provides a business method, in which it creates several CMP entity beans, something like this

public void businessMethod(int number) {
    try {

7. Problem to persist child entity in EJB

My entity bean named Stock contain

private List<StockSize> stockSizeList = new ArrayList<StockSize>();
My StockSize entity bean contain one field stockid from Stock Below is the code to set Stock entity value
Stock stock = ...

8. Is it possible to define a default persistence-context-ref for an EJB jar?

I have an EAR project in which I defined

  • a "persistance" JAR containing only the entities I want to persist (and a persistence.xml)
  • an EJB Jar containing the active components
When deploying those components ...

9. Is there a way to create a one way connection in EJB?

Here is my problem. I have an article that has a bunch of keywords/tags (where one article can have multiple tags and one tag can go to multiple articles. Here what ...

10. LockMode in EJB3 Persistence NamedQuery

How do we specify LockMode in EJB3 Persistence NamedQuery? I want to add Pessimistic LockMode to my existing select so that I can update if necessary but surprisingly Query object doesnot ...

11. EJB 3.0 and Container Managed Persistence.

What precisely is it, under 3.0 version of the Standard, that tells the container to do CMP mode on Bean lifecycle methods, versus leaving it for the coder to do BMP ...

12. NetBeans 7.0.1 Can't get EJB to persist

Hi All, I am a newbee to EJB, however, not to Java. Been playing around and created the Bean and JSF shown below. All I want to do is to have the private String question1 persist after the form is submitted, somehow, the string is not updated - I have tried looking in the GlassFish logs, which are a maze for ...

13. No persistence unit named 'entityManager' is available in scope MyFacade.jar.

Any idea about this error: No persistence unit named 'entityManager' is available in scope MyFacade.jar. Available persistence units: [] . weblogic.application.ModuleException: Exception preparing module: EJBModule(MyFacade.jar) Unable to deploy EJB: MerchantFacadeBean from MyFacade.jar: No persistence unit named 'entityManager' is available in scope MyFacade.jar. Available persistence units: [] at weblogic.ejb.container.deployer.EJBModule.prepare( at weblogic.application.internal.flow.ModuleListenerI nvoker.prepare( at weblogic.application.internal.flow.DeploymentCallb ackFlow$ at State( at weblogic.application.internal.flow.DeploymentCallb ackFlow.prepare( ...

14. Persistence API with Java SE?

Hi all Java EE fans. I am not sure if I am posting in the correct section, so apologies to the moderators. Anyway. I've been messing with Glassfish and building some simple applications using JavaEE. Love the Persistence API by the way. So I thought it could be cool to implement Persistence API into current applications at work. The software at ...

16. EJB 3.0 persistence

17. java persistence api : ejb ql

Hi, I am using java persistence api(over oracle toplinks) I have an entity customer and another entity contacts. customer is mapped with contact as one to many. the contact have a field primarycontact. I want to get the contact name from contacts for a customer where primarycontact field is true. and set this contact name as a field customercontact which is ...

18. EJB persistence.

What does persistence mean actually? Most of the times , it means persisting Java objects to a relational database. Given the "impedance mismatch" between tabular structures in the db and java objects , there are several technologies which aim to facilitate persistence by providing some sort of obj-relational (O/R) mapping. EJB is one of them. In EJB 2x, Entity Beans were ...