The following simple code throws exception:
entityManager.createQuery("SELECT c FROM Customer c");
But if I write
entityManager.createNativeQuery("SELECT c.* FROM Customer c", Customer.class)
then it works without any error. What might be wrong? I use GlassFish v2.1 with Toplink-essentials.
...
Our years-old WebLogic J2EE application has a message-driven bean which makes use of a stateless session bean. The MDB onMessage method gets the home interface of the stateless session bean and calls the home interface's create() method to get the actual stateless session bean itself.
The code does not attempt to cache the session bean...
I am calling a remote stateless session bean from a J2SE application and would like to cache the reference to the session bean in order to reduce the cost of the lookup. Is this ok?
In EJB2 the ServiceLocator pattern was commonly used to cache lookups to remote resources, but EJB3 doesn't have separate EJB Home (which were usually cach...
I am facing an issue when am getting the EntityManagerFactory from JPA from the following code in weblogic StartUp Class
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("testEJBPU");
logger.info("Created EntityManagerFactory");
Context ctx = new InitialContext();
ctx.rebind("testEJBPU", emf...
i have looked for and compreensive article on this and have yet to find one good enough.
Can some one explain to me the workings of the transaction types?
(Required, RequiresNew, Mandatory, Never...) and mainly how these affect service calls between services with diferent types?
...
Hello,
I'm currently developing a large piece of software base on JavaEE. We have followed the general guidelines of JavaEE that says that each related set of operations should go into their own EJB. We currently have over 275 different EJB classes (Stateless Session beans). This number is most likely going to grow to at least double th...
Let's say i have two tables in db: Car and Part. Car owns arbitrialy number of parts.
Because i use EJB 3.0 i have entity beans for Car and Part and Car entity bean contains list of Part objects.
I want to save new Part to db and right after that fetch from db all Cars. I exepect Part i've just added to be amongst parts associated with...
Right now I'm playing with Flex and Java integration and trying to access EJB3 methods by clicking Flex button but it's giving me null pointer error.
Here is what I have in my code:
[Controller:]
public class homePageController {
@EJB
CategoryFacadeRemote categoryFacade;
public String populateDBWithXMLData(){
Ar...
Hello,
i will use a query like this in ejb ql:
Select * from whe A&1;
But i have the following error:
line 1, column 171: unexpected char [&].
How can i use this operator to check the bits in a row?
...
At http://www.java2s.com/Code/Java/EJB3/EJBtutorialfromJBossAsynchronouscall.htm
i've found an example showing how to call ejb methods in asynchronous fashion. Do you use asynchronous proxy in EJB 3.0 on Jboss AS and does it work as it should?
...
I'd like to test my knowledge in EJB, making an small application. Could you give me some ideas for doing with EJB?
...
Using NetBeans, I do the following in the class containing main(), and it works:
import javax.ejb.EJB;
public class Master {
@EJB
TestBeanARemote x;
public static void main(String[] args) {
Master m = new Master();
m.doStuff();
}
//doStuff includes x, but it works, so who cares.
...
If I do that in a ...
I have read for a while that EJBs are not useful or cumbersome. But what other ways implement the business delegate pattern?
How do EJBs differ from the approach the Spring recommends?
Also, how have recent advances with EJBs changed your opinion.
...
I'm trying to lookup an EJB from a standalone java application. I'm thinking in terms of WebSphere Application Server 6.1, but if someone knows how to do this for another application server, it may get me in the right direction.
What I'm currently doing:
initialContext= new InitialContext(env);
initialContext.lookup("");
lc ...
I am having problems getting JBoss to inject an environment variable value into a bean. Here is my bean class:
package com.topcoder.test;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.ejb.EJBContext;
import javax.ejb.Remote;
import javax.ejb.SessionContext;
import javax.ejb.Stateles...
Are Session Beans (stateless session beans, stateful session beans) Synchronized?
...
I'm currently developing a library for monitoring calls to several remote services (WebServices, EJBs...).
One of the parameters that i would like to register is the port from which a EJB is called (a Stateless Session Bean invoked like a remote object)
There is any standarised way of getting the port? Or should I inspect the JNDI tre...
Revising some past exam papers for an exam mainly focus on component-oriented design and J2EE, I have come across the following question:
A preliminary investigation of scenario 3: “Exchange Request” suggests that two EJBs will provide a suitable solution: a session bean called EnterExchangeRequest to control the processing and an entit...
We have a Hibernate based system with Annotations.
Our entities have a custom property DELETED.
We have to select non deleted entities with non deleted sub-entities.
How can we can do it?
Little sample for describe the situation:
GenericEntity {
...
@Basic
@Column(name = DELETED)
protected Boolean deleted = false;
@...
How performant is the entity bean? Would it be too much to ask if I want 1000 objects per table (probably about 20 tables) across 5 processes where some processes might be changing the objects as often as 60 times a second?
Are there any resources out there on the limitations of the entity bean?
Thanks for any help!
...