[JBoss-user] Transaction Problem.
i am having problems resolving programmatic transactions. What i am running into is that if you have to create two entity beans in your transaction block between begin and commit, database connection which i get from Datasouce for the second bean is not able to understand that i already have one connection created by first entity bean. So it assigns new connection object for the second entity bean. Then if transaction block did not succeed then rollback fails because it can not deal with two connection objects. any thoughts? I am using programmatic approach. (i assume i don't need to put anything additional for that in ejb-jar for the transactions. Right?) -roman. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Transactions
quick question. Do any of you do transactions in your programs? if you do is jboss working ok? and what kind of transactions you are using? declarative or programmatic? I would assume that declarative should be what i have to use by putting TX_REQUIRED in my entity beans and session beans. Any know problems or issues? -thanks. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] Please Help... i have been working on this problem for 5 days
thanks for reply! why isn't it a correct way to access Datasource? -roman. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Toby Allsopp Sent: Friday, April 27, 2001 3:48 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] Please Help... i have been working on this problem for 5 days Roman Brouk wrote: > I am using BMP. The question is how to access DataSource that represents > connection pool. > > on start up JBOSS says that "[mySQLDS] XA Connection pool mySQLDS bound to > java:/mySQLDS [mySQLDS] ". I have entries in jboss.jcml. > > But in entity bean which I retrieve from JNDI, when I get connection: > > try{ > InitialContext jndiContext = new InitialContext(); > javax.sql.DataSource ds = (javax.sql.DataSource) > jndiContext.lookup("java:/mySQLDS"); > con = ds.getConnection(); > }catch(Exception ex){ > System.out.println("Looking for DataSource: " + > ex.getMessage()); > } > > > I get message that mySQLDS is not bound. That's strange. What you're doing isn't the "correct" way for an EJB to access a DataSource, but it should work. Is this all using a single JBoss instance? What does the JNDIView MBean tell you (i.e. go to port 8082, find the JNDIView MBean, invoke the list operation)? Toby. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Please Help... i have been working on this problem for 5 days
I am using BMP. The question is how to access DataSource that represents connection pool. on start up JBOSS says that "[mySQLDS] XA Connection pool mySQLDS bound to java:/mySQLDS [mySQLDS] ". I have entries in jboss.jcml. But in entity bean which I retrieve from JNDI, when I get connection: try{ InitialContext jndiContext = new InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource) jndiContext.lookup("java:/mySQLDS"); con = ds.getConnection(); }catch(Exception ex){ System.out.println("Looking for DataSource: " + ex.getMessage()); } I get message that mySQLDS is not bound. ANY IDEAS? THANKS for your time and help. -ROMAN BROUK ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Still can't find connection pool!
Was anyone able to find their connection pool (datasource)? any help will be appreciated. OK. i am using the following in java: try{ InitialContext jndiContext = new InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource) jndiContext.lookup("java:/mySQLDS"); }catch(Exception ex){ System.out.println("Looking for DataSource: " + ex.getMessage()); } This is what i am getting with JBoss starts up: [mySQLDS] Starting [mySQLDS] org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl created new Connection (org.gjt.mm.mysql.jdbc2.Connection) with XAResource org.opentools.minerva.jdbc.xa.wrapper.XAResourceImpl and XAConnection org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl. [mySQLDS] Pool mySQLDS created a new object: org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@11ae6da [mySQLDS] XA Connection pool mySQLDS bound to java:/mySQLDS [mySQLDS] No transaction right now. [mySQLDS] Pool mySQLDS [1/1/60] gave out pooled object: org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@11ae6da [mySQLDS] Pool mySQLDS [0/1/60] returned object org.opentools.minerva.jdbc.xa.wrapper.XAConnectionImpl@11ae6da to the pool. [mySQLDS] Started ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
RE: [JBoss-user] JNDI problems!
THANKS for you responce! i will definatly do that. -roman. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Toby Allsopp Sent: Thursday, April 26, 2001 11:59 AM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] JNDI problems! First, WTF does this have to do with JNDI? On Thu, Apr 26, 2001 at 10:40:08AM -0700, Roman Brouk wrote: > can somebody explain to me why if i have in my jboss.conf: > > CODEBASE="../../lib/ext/"> > > VALUE="org.jboss.minerva.xa.XADataSourceImpl"> > > > > then each time i start jboss the following lines are deleted from > jboss.jcml file? Use a newer version of JBoss. This behaviour was removed between the 2.0 and 2.1 releases. Toby. ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] JNDI problems!
can somebody explain to me why if i have in my jboss.conf: then each time i start jboss the following lines are deleted from jboss.jcml file? I assume this might be the reason i can not find the pool through JNDI "java:/mySQLDB" although when jboss starts it says that "XA Connection pool mySQLDB bound to java:/mySQLDB"? MySQLDB org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl I am getting very annoyed with this! please help! ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] Connection Pool and JNDI lookup
I have 2 questions that need to be resolve using JBOSS server: 1. For some reason jndi lookup is not finding entity beans consistently, although jboss server on the start-up says "[Container factory] Deploying CustomerHistory". For example, we do have an entry in ejb-jar.xml with: CustomerHistory com.cogenia.server.entities.CustomerHistoryHome com.cogenia.server.entities.CustomerHistoryRemote com.cogenia.server.entities.CustomerHistoryEntityBean Bean com.cogenia.server.entities.CustomerHistoryPrimKey False Sometimes jndi is able to located, sometimes it doesn't. the java code used to do a lookup is as follows: Object ref = null; try { System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); System.setProperty("java.naming.provider.url", "localhost"); InitialContext jndiContext = new InitialContext(); ref = jndiContext.lookup("CustomerHistory"); }catch(Exception e) { //ERROR OCCURES HERE!!} 2. We have entity bean persistance. Is transaction support only works if connection pool is used? What are the correct steps to bound connection. We followed everything in the spec. We have mySQL database. When jboss started it says "[MySQLDB] XA Connection pool MySQLDB bound to java:/MySQLDB" but when JNDI lookup is used in java to locate connection pool with name "java:/MySQLDB" we get the error of the poolname not beeing bound. here is what we did: in jboss.properties i added: jdbc.drivers=org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver in jboss.conf i added: in jboss.jcml i added (notice that PoolName and DataSourceClass is missing. for some reason although i add poolname as an attribute it will be deleted when i start up jboss): 120 0 jdbc:mysql://localhost/CogeniaDB false false false true 12 180 false false 1.0 0 in Java to do a JNDI lookup we have: Connection con = null; try{ InitialContext jndiContext = new InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource) jndiContext.lookup("java:/MySQLDB"); con = ds.getConnection(); }catch(javax.naming.NamingException exne) { //ERROR OCCURES HERE!! System.out.println("*** " + exne.getMessage()); } ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user
[JBoss-user] connection pool - Help
Please help! Thanks... I have 2 questions that need to be resolve using JBOSS server: 1. For some reason jndi lookup is not finding entity beans consistently, although jboss server on the start-up says "[Container factory] Deploying CustomerHistory". For example, we do have an entry in ejb-jar.xml with: CustomerHistory com.cogenia.server.entities.CustomerHistoryHome com.cogenia.server.entities.CustomerHistoryRemote com.cogenia.server.entities.CustomerHistoryEntityBean Bean com.cogenia.server.entities.CustomerHistoryPrimKey False Sometimes jndi is able to located, sometimes it doesn't. the java code used to do a lookup is as follows: Object ref = null; try { System.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); System.setProperty("java.naming.provider.url", "localhost"); InitialContext jndiContext = new InitialContext(); ref = jndiContext.lookup("CustomerHistory"); }catch(Exception e) { //ERROR OCCURES HERE!!} 2. We have entity bean persistance. Is transaction support only works if connection pool is used? What are the correct steps to bound connection. We followed everything in the spec. We have mySQL database. When jboss started it says "[MySQLDB] XA Connection pool MySQLDB bound to java:/MySQLDB" but when JNDI lookup is used in java to locate connection pool with name "java:/MySQLDB" we get the error of the poolname not beeing bound. here is what we did: in jboss.properties i added: jdbc.drivers=org.gjt.mm.mysql.Driver,oracle.jdbc.driver.OracleDriver in jboss.conf i added: in jboss.jcml i added (notice that PoolName and DataSourceClass is missing. for some reason although i add poolname as an attribute it will be deleted when i start up jboss): 120 0 jdbc:mysql://localhost/CogeniaDB false false false true 12 180 false false 1.0 0 in Java to do a JNDI lookup we have: Connection con = null; try{ InitialContext jndiContext = new InitialContext(); javax.sql.DataSource ds = (javax.sql.DataSource) jndiContext.lookup("java:/MySQLDB"); con = ds.getConnection(); }catch(javax.naming.NamingException exne) { //ERROR OCCURES HERE!! System.out.println("*** " + exne.getMessage()); } ___ JBoss-user mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/jboss-user