You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Ritu Kedia <RK...@saba.com> on 2004/03/12 15:40:25 UTC

RE: JBoss help

Something that may be useful to those using JBoss and facing problem with
explicit commits and rollbacks (as described by Igor in the first mail of
this thread):

Initially I had applied Oliver's patch (of committing the explicit commits
and rollbacks), to deploy Slide in JBoss. However that is not required if
you define the <res-auth> of the DataSource in web.xml as "SERVLET". 
Sample:
   <resource-ref>
       <res-ref-name>jdbc/slideDS</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>SERVLET</res-auth>
   </resource-ref>

Regards,
Ritu


-----Original Message-----
From: Igor I. Nuzhnov [mailto:igor@malva.ua]
Sent: Tuesday, December 09, 2003 12:33 PM
To: Slide Users Mailing List
Subject: Re: JBoss help


Thank you for the help, Oliver
After your patch, all works just fine
Can you, please, make usage of commit and rollback in AbstractRDBMSStore
configurable (Domain.xml)

And another question
When I use new TxFileStore on slide start I get exception
...
08:13:58,078 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.common.Namespace - INFO - Content store:
org.apache.slide.store.txfile.TxFileContentStore
08:13:58,125 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.store.txfile.AbstractTxFileStoreService - INFO - File Store
configured to store/content, working directory work/content
...
08:13:58,203 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.store.txfile.rm.impl.FileResourceManager - INFO - Starting
RM at 'store/content' / 'work/content'
08:13:58,203 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.store.txfile.rm.impl.FileResourceManager - INFO -
Recovering dwarf
08:13:58,218 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.store.txfile.rm.impl.FileResourceManager - EMERGENCY -
Recovering status information from 'work/content/dwarf/transaction.log'
faile
d! Could not find file
08:13:58,218 INFO  [STDOUT] 09 Dec 2003 08:13:58 -
org.apache.slide.store.txfile.rm.impl.FileResourceManager - EMERGENCY -
java.io.FileNotFoundException: work\content\dwarf\transaction.log
08:13:58,218 ERROR [STDERR] java.io.FileNotFoundException:
work\content\dwarf\transaction.log
08:13:58,218 ERROR [STDERR]     at java.io.FileInputStream.open(Native
Method)
08:13:58,218 ERROR [STDERR]     at
java.io.FileInputStream.<init>(FileInputStream.java:106)
08:13:58,218 ERROR [STDERR]     at
org.apache.slide.store.txfile.rm.impl.FileResourceManager$TransactionContext
.recoverState(FileResourceManager.java:1517)
08:13:58,218 ERROR [STDERR]     at
org.apache.slide.store.txfile.rm.impl.FileResourceManager.recoverContexts(Fi
leResourceManager.java:1243)
08:13:58,218 ERROR [STDERR]     at
org.apache.slide.store.txfile.rm.impl.FileResourceManager.recover(FileResour
ceManager.java:480)
08:13:58,218 ERROR [STDERR]     at
org.apache.slide.store.txfile.rm.impl.FileResourceManager.start(FileResource
Manager.java:433)
08:13:58,281 ERROR [STDERR]     at
org.apache.slide.store.txfile.AbstractTxFileStoreService.connect(AbstractTxF
ileStoreService.java:160)
08:13:58,281 ERROR [STDERR]     at
org.apache.slide.common.AbstractServiceBase.connect(AbstractServiceBase.java
:162)
08:13:58,281 ERROR [STDERR]     at
org.apache.slide.store.AbstractStore.connect(AbstractStore.java:227)
08:13:58,281 ERROR [STDERR]     at
org.apache.slide.common.AbstractServiceBase.connectIfNeeded(AbstractServiceB
ase.java:234)
08:13:58,281 ERROR [STDERR]     at
org.apache.slide.common.Namespace.connectService(Namespace.java:534)
08:13:58,328 ERROR [STDERR]     at
org.apache.slide.common.Namespace.retrieveStore(Namespace.java:633)
08:13:58,328 ERROR [STDERR]     at
org.apache.slide.common.Uri.parseUri(Uri.java:379)
08:13:58,328 ERROR [STDERR]     at
org.apache.slide.common.Uri.<init>(Uri.java:106)
08:13:58,328 ERROR [STDERR]     at
org.apache.slide.common.Namespace.getUri(Namespace.java:681)
08:13:58,328 ERROR [STDERR]     at
org.apache.slide.common.Namespace.getUri(Namespace.java:661)
...

As I understand, slide can't set correct txId:
        public synchronized void recoverState() throws
ResourceManagerException {
            String statePath = workDir + "/" + txId + "/" + CONTEXT_FILE;
'work\content\dwarf\transaction.log'

but transaction log in 'work\content\dwarf\65\transaction.log'

Thanks

Igor

----- Original Message ----- 
From: "Oliver Zeigermann" <ol...@zeigermann.de>
To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
Sent: Monday, December 08, 2003 10:02 PM
Subject: Re: JBoss help


> Hi Igor,
>
> I suppose you use the patch provided by Grant that allows for external
> TMs, right? I have never tried it and did not check with JBoss as well,
> so I can only guess. When I was merging the stores I was really
> wondering if a commit on the XAResource should also commit the
> transaction as one implementation did and another did not. If I remember
> correctly the implementation that was in
> org.apache.slide.store.impl.rdbms before did not, but now does. Did you
> use this implementation before? Slide's TM does not commit the
> transaction, except over the XAResource, I guess JBoss is closer to the
> specification and actually does as it has a full transactional resource
> including the connection and the XAResource. Can any expert please check
> if I am correct here? At least the exceptions you present here perfectly
> match what I suspect...
>
> For now simply try to comment out the rollbacks and commit on the
> connection and see if it works. I suppose you know how to do this, if
> not use the attached patch. Please report back success or failure.
>
> Thanks,
>
> Oliver
>
>
> Igor I. Nuzhnov wrote:
> > Hello, all
> > I try to configure Slide from CVS HEAD for work with JBoss 3.2.3
> > I want to use new J2EEStore, but get many transaction errors, such as
> >
> > 15:55:36,750 INFO  [STDOUT] 08 Dec 2003 15:55:36 -
> > org.apache.slide.common.Namespace - INFO - Loading namespace slide base
data
> > 15:55:36,843 WARN  [TransactionImpl] XAException:
tx=TransactionImpl:XidImpl
> > [FormatId=257, GlobalId=dwarf//61, BranchQual=] errorCode=XA_HEURCOM
> > javax.transaction.xa.XAException
> >         at
> >
org.apache.slide.store.impl.rdbms.AbstractRDBMSStore.rollback(AbstractRDBMSS
> > tore.java:396)
> >         at
> >
org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1664)
> >         at
org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:458)
> >         at org.jboss.tm.TxManager.rollback(TxManager.java:264)
> >         at
> > org.apache.slide.common.Namespace.loadBaseData(Namespace.java:802)
> >         at org.apache.slide.common.Domain.initNamespace(Domain.java:857)
> >         at org.apache.slide.common.Domain.init(Domain.java:476)
> >         at org.apache.slide.common.Domain.init(Domain.java:410)
> >         at org.apache.slide.common.Domain.init(Domain.java:373)
> >         at
> > org.apache.slide.webdav.WebdavServlet.init(WebdavServlet.java:294)
> >         at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> >         at
> > org.apache.slide.webdav.WebdavServlet.init(WebdavServlet.java:236)
> > ...
> > ...
> > 15:55:38,828 WARN  [TransactionImpl] XAException:
tx=TransactionImpl:XidImpl
> > [FormatId=257, GlobalId=dwarf//65, BranchQual=] errorCode=XA_RBCOMMFAIL
> > javax.transaction.xa.XAException
> >         at
> >
org.apache.slide.store.impl.rdbms.AbstractRDBMSStore.commit(AbstractRDBMSSto
> > re.java:354)
> >         at
> > org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1593)
> >         at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:395)
> >         at org.jboss.tm.TxManager.commit(TxManager.java:141)
> >         at
> >
org.apache.slide.common.NamespaceAccessTokenImpl.commit(NamespaceAccessToken
> > Impl.java:452)
> >         at
> > org.apache.slide.common.Namespace.loadBaseData(Namespace.java:825)
> >         at org.apache.slide.common.Domain.initNamespace(Domain.java:857)
> >         at org.apache.slide.common.Domain.init(Domain.java:476)
> >         at org.apache.slide.common.Domain.init(Domain.java:410)
> >         at org.apache.slide.common.Domain.init(Domain.java:373)
> >         at
> > org.apache.slide.webdav.WebdavServlet.init(WebdavServlet.java:294)
> >         at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> >         at
> > org.apache.slide.webdav.WebdavServlet.init(WebdavServlet.java:236)
> >         at
> >
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:93
> > 5)
> >
> >
> > Here is my configuration:
> >
> > [web.xml]
> > ...
> >  <resource-ref>
> >   <res-ref-name>jdbc/HRMDS</res-ref-name>
> >   <res-type>javax.sql.DataSource</res-type>
> >   <res-auth>Container</res-auth>
> >  </resource-ref>
> >  <resource-ref>
> >   <res-ref-name>TransactionManager</res-ref-name>
> >   <res-type>javax.transaction.TransactionManager</res-type>
> >   <res-auth>Container</res-auth>
> >  </resource-ref>
> > ...
> >
> > [jboss-web.xml]
> > ...
> >     <resource-ref>
> >         <res-ref-name>jdbc/HRMDS</res-ref-name>
> >         <jndi-name>java:/XAHRMDS</jndi-name>
> >     </resource-ref>
> >     <resource-ref>
> >         <res-ref-name>TransactionManager</res-ref-name>
> >         <jndi-name>java:/TransactionManager</jndi-name>
> >     </resource-ref>
> > ...
> >
> > [Domain.xml]
> > ...
> >         <definition>
> >       <transaction-manager
> > type="jndi">TransactionManager</transaction-manager>
> >             <store name="j2ee"
> > classname="org.apache.slide.store.ExtendedStore">
> >                 <nodestore
> > classname="org.apache.slide.store.impl.rdbms.J2EEStore">
> >                     <parameter name="datasource">jdbc/HRMDS</parameter>
> >                     <parameter
> >
name="adapter">org.apache.slide.store.impl.rdbms.SQLServerRDBMSAdapter</para
> > meter>
> >                 </nodestore>
> >                 <securitystore>
> >                     <reference store="nodestore"/>
> >                 </securitystore>
> >                 <lockstore>
> >                     <reference store="nodestore"/>
> >                 </lockstore>
> >                 <revisiondescriptorsstore>
> >                     <reference store="nodestore"/>
> >                 </revisiondescriptorsstore>
> >                 <revisiondescriptorstore>
> >                     <reference store="nodestore"/>
> >                 </revisiondescriptorstore>
> >                 <contentstore>
> >                     <reference store="nodestore"/>
> >                 </contentstore>
> >             </store>
> >             <scope match="/" store="j2ee"/>
> >         </definition>
> > ...
> >
> > [hrm-ds.xml]
> > ...
> >   <xa-datasource>
> >     <jndi-name>XAHRMDS</jndi-name>
> >     <track-connection-by-tx>true</track-connection-by-tx>
> >
> >
<xa-datasource-class>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</xa-d
> > atasource-class>
> >     <xa-datasource-property
name="ServerName">gnome</xa-datasource-property>
> >     <xa-datasource-property
name="PortNumber">1433</xa-datasource-property>
> >     <xa-datasource-property
name="DatabaseName">hrm</xa-datasource-property>
> >     <xa-datasource-property
> > name="SelectMethod">cursor</xa-datasource-property>
> >     <xa-datasource-property
> > name="SendStringParametersAsUnicode">true</xa-datasource-property>
> >     <user-name>sa</user-name>
> >     <password></password>
> >   <min-pool-size>10</min-pool-size>
> >   <max-pool-size>50</max-pool-size>
> >   <blocking-timeout-millis>5000</blocking-timeout-millis>
> >   <idle-timeout-minutes>15</idle-timeout-minutes>
> >   </xa-datasource>
> > ...
> >
> > Please, help me
> >
> > By
> >
> > Igor Nuzhnov, igor@malva.ua
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: slide-user-help@jakarta.apache.org
> >
> >
>
>
>


----------------------------------------------------------------------------
----


> Index: AbstractRDBMSStore.java
> ===================================================================
> RCS file:
/home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/Abstrac
tRDBMSStore.java,v
> retrieving revision 1.1
> diff -u -r1.1 AbstractRDBMSStore.java
> --- AbstractRDBMSStore.java 3 Dec 2003 12:00:46 -0000 1.1
> +++ AbstractRDBMSStore.java 8 Dec 2003 20:00:54 -0000
> @@ -344,9 +344,9 @@
>          try {
>              if (id.rollbackOnly) {
>
> -                conn.rollback();
> +//                conn.rollback();
>              } else {
> -                conn.commit();
> +//                conn.commit();
>              }
>              activeTransactionContext.set(null);
>
> @@ -389,12 +389,12 @@
>              throw new XAException(XAException.XAER_NOTA);
>          }
>
> -        try {
> -            conn.rollback();
> +//        try {
> +//            conn.rollback();
>              activeTransactionContext.set(null);
> -        } catch (SQLException e) {
> -            throw new XAException(XAException.XA_HEURCOM);
> -        } finally {
> +//        } catch (SQLException e) {
> +//            throw new XAException(XAException.XA_HEURCOM);
> +//        } finally {
>              try {
>                  conn.close();
>                  /* We must always return connections to the pool,
> @@ -402,7 +402,7 @@
>              } catch (SQLException e) {
>                  getLogger().log(e, LOG_CHANNEL, Logger.ERROR);
>              }
> -        }
> +//        }
>      }
>
>      /**
>
>


----------------------------------------------------------------------------
----


> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-user-help@jakarta.apache.org