3 Replies Latest reply on Dec 13, 2004 2:41 PM by pavel.kolesnikov

    hsqldb vs. MySQL and other ramblings

    theute

      You should be able to use any database with a JDBC connector (as we use Hibernate)

      hsqlb should work fine. We will probably provide such a package when Jboss portal will be out (with JBoss included). Please again, remember that JBoss portal is not out yet, you are free to play with it though.

      Jboss portal extends the portlet API and let a portlet define authorization based on roles.

      There will be the equivalent of the HTML module of nukes.


        • 1. Re: Nullvalues in messageblob with Oracle as persistence lay
          pavel.kolesnikov

          Hi

          We are looking for the cause of the problem described above and we could narrow the failure as follows:

          Everytime if we read the message out of the queue the attribute messageblob will set to NULL in the database. This function is implemented within an EJB with a container managed transaction. The queue session and the queue connection will be opened within this transaction.

          If we produce an error in the listener for the message (wich is already in the transaction) and the listener throw a RemoteException the db actions inside the transaction should naturally rollbacked.

          Therefor we make the following test:
          We set the attribute messageblob in the database to 'NOT NULL' to see the code place wich cause the update on JMS_MESSAGES talble. Following error occured into the jboss log:

          15:58:46,255 ERROR [BasicQueue] Caught unusual exception in restoreMessageTask.
          org.jboss.mq.SpyJMSException: Could not update message: 1 msg=0 hard STORED PERSISTENT queue=QUEUE.serverReceiveQueue pr
          iority=4 lateClone=false hashCode=18005332; - nested throwable: (java.sql.SQLException: ORA-01407: Aktualisieren von ("M
          AQS"."JMS_MESSAGES"."MESSAGEBLOB") zu NULL nicht m÷glich
          )
           at org.jboss.mq.pm.jdbc2.PersistenceManager.update(PersistenceManager.java:921)
           at org.jboss.mq.server.BasicQueue$RestoreMessageTask.run(BasicQueue.java:1043)
           at org.jboss.mq.pm.Tx.commit(Tx.java:159)
           at org.jboss.mq.pm.TxManager.commitTx(TxManager.java:89)
           at org.jboss.mq.server.JMSDestinationManager.transact(JMSDestinationManager.java:440)
           at org.jboss.mq.server.JMSServerInterceptorSupport.transact(JMSServerInterceptorSupport.java:186)
           at org.jboss.mq.security.ServerSecurityInterceptor.transact(ServerSecurityInterceptor.java:182)
           at org.jboss.mq.server.TracingInterceptor.transact(TracingInterceptor.java:438)
           at org.jboss.mq.server.JMSServerInvoker.transact(JMSServerInvoker.java:186)
           at org.jboss.mq.il.jvm.JVMServerIL.transact(JVMServerIL.java:327)
           at org.jboss.mq.Connection.send(Connection.java:1206)
           at org.jboss.mq.SpyXAResourceManager.rollback(SpyXAResourceManager.java:247)
           at org.jboss.mq.SpyXAResource.rollback(SpyXAResource.java:154)
           at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1732)
           at org.jboss.tm.TransactionImpl.rollback(TransactionImpl.java:461)
           at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:448)
           at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:324)
           at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
           at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:120)
           at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
           at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
           at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
           at org.jboss.ejb.Container.invoke(Container.java:723)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:324)
           at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
           at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
           at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
           at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
           at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
           at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:97)
           at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
           at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
           at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:53)
           at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:100)
           at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
           at $Proxy64.readMessage(Unknown Source)
           at com.maqsima.wms.dm.jmx.DMThread.run(DMThread.java:146)
          Caused by: java.sql.SQLException: ORA-01407: Aktualisieren von ("MAQS"."JMS_MESSAGES"."MESSAGEBLOB") zu NULL nicht m÷gli
          ch
          
           at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
           at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
           at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:579)
           at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1894)
           at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1094)
           at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2132)
           at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2015)
           at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2877)
           at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:608)
           at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:335)
           at org.jboss.mq.pm.jdbc2.PersistenceManager.update(PersistenceManager.java:900)
           ... 40 more


          It seems that the update-function in the org.jboss.mq.pm.jdbc2.PersistenceManager is responsible for this failure.

          Any ideas?

          Karsten

          • 2. Re: hsqldb vs. MySQL and other ramblings

            I tried to use HSqlDb with nukes (JBoss 4.0.0 + Nukes2.0). For that i had changed "nukes-ds.xml" to have.
            ... <jndi-name>NukesDS</jndi-name>
            <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
            <driver-class>org.hsqldb.jdbcDriver</driver-class> ...

            Also i had created the objects in HSQLDB using the DDLs from "setup.ddl" that i had build at nukes-2.0\core\output\resources. (Of course i had to change the Sqls for HSQLDB syntax ).

            The Nukes deployment went well (Except the error : INFO [ServiceConfigurator] Problem configuring service jboss:service=Mail) and i am able to access the portal page at http://localhost:8080/nukes/.

            I think the DB connectivity is OK since i could see the user details entered in table "JBP_USERS" in HSQL DB, when i tried to create new user. But i get the following errors :

            ERROR [JDBCExceptionReporter] Unexpected token: LAST_INSERT_ID in statement [SELECT LAST_INSERT_ID()]
            ERROR [JDBCExceptionReporter] could not insert: [org.jboss.nukes.core.impl.user.UserImpl]

            I guess "LAST_INSERT_ID()" is a MySql function. Can you let me know what other configuration (for HSqlDB) i have to do ?. Or is it not possible to use HSQLDB with the above JBoss\Nukes versions ???

            • 3. Re: hsqldb vs. MySQL and other ramblings
              freddt

              The HSQLDB equivalent of SELECT LAST_INSERT_ID() is gererally:

              CALL IDENTITY();