There is something wrong with your email. I have responded to it - twice. http://www.mail-archive.com/jboss-user%40lists.sourceforge.net/msg32302.html http://www.mail-archive.com/jboss-user%40lists.sourceforge.net/msg32327.html
Regards, Adrian On Fri, 2003-09-26 at 14:51, rajeshnn wrote: > Hi > I havent yet got a reply to my query as mentioned below in the mail. I am not able > yo proceed with the work because of this. > My application works witout any problem in J2EE & Oracle 9iAS > > Could you pls help > > Regards > Rajesh > > -----Original Message----- > From: rajeshnn > Sent: Thursday, September 25, 2003 3:44 PM > To: [EMAIL PROTECTED] > Subject: RE: [JBoss-user] error while trying to open a new connection > > > Hi Adrian > We are providing you the sample code . It contains a servlet and a stateful session > bean. > In the ejbCreate we are creating a connection and we are setting autoCommit to false > at that time. > The servlet creates the bean and will call the doQuery() method. At this point the > autoCommit attribute is coming as true. > We are using bean managed persistence. > we have set the attribute SpecCompliant as true in transaction-service.xml. > > Why is this happening and how can we solve the issue? > > The example code is attached along with this. > > > Regards > Rajesh > > > -----Original Message----- > From: Adrian Brock [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 24, 2003 6:30 PM > To: [EMAIL PROTECTED] > Subject: RE: [JBoss-user] error while trying to open a new connection > > > Again you'll have to give me some information. > Where is getConnection() invoked and where do you store the connection? > What is done between getting the connection and the commit()? > Is this a StatefulSessionBean? > What is the deployment descriptor for the resource-ref? > > What does the following return just before the commit(): > m_dbCon.getAutoCommit(); > ((org.jboss.resource.adapter.jdbc.WrappedConnection) > m_dbCon).getUnderylingConnection().getAutoCommit(); > > You know this kind of pattern won't scale. You are not > using the pool. You will need one db connection per user. > > Regards, > Adrian > > On Wed, 2003-09-24 at 07:48, rajeshnn wrote: > > Hi Adrian > > Thanks you very much for the quick response. > > > > The issue described in the earlier mail(below) has been solved while using > > jboss-3.2.2RC4 ( latest jboss release ), as advised by you. > > Now i am facing a new error. > > > > java.sql.SQLException: You cannot commit with autocommit set! > > > > I had also set CachedConnectionManager in transaction-service.xml( > > SpecCompliant to true ) ), > > > > code is given below: > > =============== > > public Connection getConnection(){ > > String m_strDefaultDataSource ="java:comp/env/jdbc/Data"; > > > > InitialContext ic = new InitialContext(); > > DataSource m_dsCommmon = ( DataSource ) ic.lookup( m_strDefaultDataSource ); > > m_dbCon = m_dsCommmon.getConnection(); > > m_dbCon.setAutoCommit(false); > > > > return m_dbCon; > > } > > > > private boolean storeSignInDetails(String strUserName,String strClientIp , > > Connection m_dbCon){ > > > > String strUserId = getUserId(); > > strUserId = ( null == strUserId )?"Invalid":strUserId; > > > > String strQuery ="//sql statement for logging // > > try{ > > Statement stmt = m_dbCon.createStatement(); > > int iCount = stmt.executeUpdate(strQuery); > > m_dbCon.commit(); > > > > }catch(Exception e){ > > e.printStackTrace(); > > return false; > > } > > > > return true; > > > > } > > > > // Also pls note that i am not closing the connection, as this is used for further > > transaction. > > // We are using bean managed transaction . We are handling the transaction using > > JDBC only (not using JavaTransaction API). > > //Initially after successful logging of the user, the user details are logged and > > it is commited > > ( Given in the above function --storeSignInDetails () ). > > //Later it is commited , only when the user finishes his transaction. > > // So we need to use setAutoCommit( false ); > > > > Is there any way to prevent this issue.... > > > > Also can u please clarify as to what JBoss is expecting. Do we need to disable > > CachedConnectionManager?? > > > > > > 10:45:37,843 ERROR [STDERR] java.sql.SQLException: You cannot commit with > > autocommit set! > > 10:45:37,859 ERROR [STDERR] at > > org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.jdbcCommit > > BaseWrapperManagedConnection.java:494) > > 10:45:37,859 ERROR [STDERR] at > > org.jboss.resource.adapter.jdbc.WrappedConnection.commit(WrappedConnection.java:465) > > 10:45:37,859 ERROR [STDERR] at > > com.suntec.tbms3.ui.CUserValidateSB.storeSignInDetails(CUserValidateSB.java:318) > > > > > > > > This electronic mail (including any attachment thereto) may be confidential and > privileged and is intended only for the individual or entity named above. Any > unauthorized use, printing, copying, disclosure or dissemination of this > communication may be subject to legal restriction or sanction. Accordingly, if you > are not the intended recipient, please notify the sender by replying to this email > immediately and delete this email (and any attachment thereto) from your computer > system...Thank You > > > > > This electronic mail (including any attachment thereto) may be confidential and > privileged and is intended only for the individual or entity named above. Any > unauthorized use, printing, copying, disclosure or dissemination of this > communication may be subject to legal restriction or sanction. Accordingly, if you > are not the intended recipient, please notify the sender by replying to this email > immediately and delete this email (and any attachment thereto) from your computer > system...Thank You -- xxxxxxxxxxxxxxxxxxxxxxxx Adrian Brock Director of Support Back Office JBoss Group, LLC xxxxxxxxxxxxxxxxxxxxxxxx ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user