[Persistence, JBoss/CMP, Hibernate, Database] - Issue with persistence | No inserts/updates statements getti
by agup10
Context
I have a session scoped seam component from where I am invoking a method persistUserFund() in domain layer.
Seam version: 2.0.1.GA
Problem Statement
The method persistUserFund() does not fire an inserts/updates/deletes and the data is not peristed into theoracle database
Problem Explanation
The method in domain layer has the following code block. I am using session.flush to flush the session so that the inserts/updates/deletes could get fired.
persistUserFund() {
Session session = getSession();
Block block = userfund.removeBlock();
session.flush();
userfund.setMainBlock(block);
session.flush();
}
I tried executing the above method using TestNG and the method executes successfully generating inserts/updates statements.
However, from the session scoped seam component, no inserts/updates/deletes are generated.
I have tried using Conversation.changeFlushMode(FlushModeType.MANUAL); at the start of the method in seam component and Conversation.changeFlushMode(FlushModeType.AUTO); at the end of the seam component. But even this did not help.
Could someone provide any insights to help me solve this problem?
Thanks in Advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155625#4155625
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155625
17 years, 10 months
[EJB 3.0] - Re: Problem with Bean
by jaikiran
anonymous wrote : javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is j
| avax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception
| is java.net.ConnectException: Connection refused: connect]]
| at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:274)
| at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1533)
| at org.jnp.interfaces.NamingContext.rebind(NamingContext.java:487)
| at javax.naming.InitialContext.rebind(InitialContext.java:412)
| at org.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
| at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
| at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:306)
| at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:713)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.
| java:127)
In your LoginBean.jar you probably are not including a jndi.properties file, because of which the default localhost:1099 is being used. But since you start the server using run -b [IP], the JNDI and other services are not available at localhost. Include a jndi.properties with the following contents:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.provider.url=jnp://[IP]:1099
| java.naming.factory.url.pkgs=org.jboss.naming.jnp.interfaces
|
|
Replace the [IP] appropriately in this jndi.properties file.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155585#4155585
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155585
17 years, 10 months