[Persistence, JBoss/CMP, Hibernate, Database] - Using JBoss's JDBC Managed Connection Pools
by wls
Hello - need some to point me in the right direction.
I have some JDBC code that was working perfectly until I changed it to use JBoss's managed connection pools. I'm hoping someone can point me to an authoritative reference source online instructing proper usage of the connection pools.
Before I was getting a connection, setting setAutoCommit() to false, doing a number of statements, calling commit(), and then closing the connection -- worked great.
Now I'm getting a connection, (can't touch auto commit though it seems to be false), doing a number of statements, (can't call commit() or rollback() -why?), and then closing the connection -- which doesn't seem to do the commit. In fact, shortly after close(), I can go look with a db admin tool and the tables show no evidence of any INSERT statements happening. ...wait a while, and perhaps it might.
It's acting like close() releases to the pool, but the commit() may be done later. This is not good news for other pieces of code expecting something to now be in the database.
Clearly I'm missing something -- what's the right group to ask such questions of, or, optionally, what's the right piece of documentation I should be looking at?
-Walt Stoneburner
wls(a)wwco.com
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012691#4012691
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012691
19Â years, 2Â months
[JBoss jBPM] - Re: BPEL + WSIF
by alex.guizarï¼ jboss.com
Recalling the discussion in Native Java Code (POJO) Invocation incorporating WSIF is technically possible but has not been done so far. Apart from other priorities such as covering the BPEL specification and integrating with the designer, WSIF is a Java framework, intended to deal with Java objects, not XML info items.
It is not clear to me what requirements WSIF would address. These days, with EJB3 and JSR-181/JAX-WS, it is trivial to turn a session bean or a plain object into a web service. Performance is another word that is mentioned. However, as explained in the topic referenced in the previous paragraph, the real performance hit comes from XML binding.
>From the perspective of a (standard) BPEL process having XML-typed variables, the best performing invocations occur with partners able to process XML directly or with minimal transformations, compared to partners that require complex binding to an object graph.
Local vs. remote invocations are a separate issue outside the scope of the BPEL engine. It depends on the underlying web service implementation and network stack.
If you could shred some light on what your requirements are for WSIF, it'd be great.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012687#4012687
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012687
19Â years, 2Â months
[JNDI/Naming/Network] - Re: Converting code from BEA WebLogic to JBoss
by jaikiran
anonymous wrote : The following code snippet is from the servlet we developed (before creating the context)
| -------------------------------------------------------------------------------------
| if (props == null) {
| props = new Properties();
| props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
| props.setProperty(Context.PROVIDER_URL, "t3://10.10.10.12:7001");
| }
| -------------------------------------------------------------------------------------
Ideally these should have come from a properties file. Since you mention that this code belongs to a Servlet, you can just delete this part of code and use the default constructor of InitialContext. Something like:
Context ctx = new InitialContext();
You dont have to pass the properties. JBoss will look into the classpath for a file named jndi.properties (which is by default shipped with JBoss with the appropriate entries) and use it while doing the lookup.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012685#4012685
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012685
19Â years, 2Â months
[JBoss and NetBeans] - Re: NameNotFoundException: DefaultDS not bound - Entity Unit
by htran_888
Hi L,
By prepending the "java:/" to DefaultDS in persistence.xml file did fixed the binding issue. I have tried this in the past but did not redeploy correctly. Anyhow, I now receive the following error when running the Client.java on the titan.jar EJB:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:645)
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:325)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at client.Client.main(Client.java:31)
Here is the code for Client.java:
package client;
import travelagent.TravelAgentRemote;
import domain.Cabin;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
public class Client
| {
| public static void main(String [] args)
| {
| try
| {
| Context ctx = getInitialContext();
| Object ref = (TravelAgentRemote) ctx.lookup("TravelAgentRemote");
| TravelAgentRemote dao = (TravelAgentRemote)
| PortableRemoteObject.narrow(ref,TravelAgentRemote.class);
|
| Cabin cabin_1 = new Cabin();
| cabin_1.setId(1);
| cabin_1.setName("Master Suite");
| cabin_1.setDeckLevel(1);
| cabin_1.setShipId(1);
| cabin_1.setBedCount(3);
|
| dao.createCabin(cabin_1);
|
| Cabin cabin_2 = dao.findCabin(1);
| System.out.println(cabin_2.getName());
| System.out.println(cabin_2.getDeckLevel());
| System.out.println(cabin_2.getShipId());
| System.out.println(cabin_2.getBedCount());
|
| }
| catch (javax.naming.NamingException ne)
| {
| ne.printStackTrace();
| }
| }
|
| public static Context getInitialContext()
| throws javax.naming.NamingException
| {
| return new javax.naming.InitialContext();
| }
| }
Thanks again,
Henry
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012683#4012683
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012683
19Â years, 2Â months