8 Replies Latest reply on Mar 24, 2011 12:00 AM by Steven Hawkins

    Problem using Jboss Seam and Teiid: version "latest" does not exist

    Gelson Perim Newbie

      Hi,

       

      I have a problem with Teiid 7.3.0 in Seam 2.2: I configure the project using the documentation example (quick_start_example) and a find many dificulties.

       

      Problem 1: Now jboss complains '[ConnectionException]VDB "ensaiosTeiid" version "latest" does not exist.', while he Start.

       

      Problem 2: When my application start and i try insert a data, i receive this message: 03:37:21,675 ERROR [TableGenerator] could not read a hi value org.teiid.jdbc.TeiidSQLException: Group does not exist: hibernate_unique_key.

       

      My id entity example :

       

          @Id @GeneratedValue(strategy=GenerationType.IDENTITY)

          private Long id;

       

      My persitence.xml:

       

         <persistence-unit name="ensaios" transaction-type="JTA">

            <provider>org.hibernate.ejb.HibernatePersistence</provider>

            <jta-data-source>ensaiosDatasource</jta-data-source>

            <properties>

               <property name="hibernate.dialect" value="org.teiid.dialect.TeiidDialect"/>

               <property name="hibernate.hbm2ddl.auto" value="update"/>

               <property name="hibernate.show_sql" value="true"/>

               <property name="hibernate.format_sql" value="false"/>

               <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->

              <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.JBossTransactionManagerLookup"/>

            </properties>

         </persistence-unit>

       

      My ensaios-dev-ds.xml: (used in seam)

       

          <datasources>

           <local-tx-datasource>

            <jndi-name>ensaiosDatasource</jndi-name>

            <use-java-context>false</use-java-context>

            <connection-url>jdbc:teiid:ensaiosTeiid@mm://localhost:31000</connection-url>

            <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>

            <user-name>user</user-name>

            <password>user</password>

           </local-tx-datasource>

          </datasources>

       

      My others datasources used in teiid (ensaiosTeiid.vdb):

       

      - Ensaios-ds.xml

       

          <xa-datasource>

            <jndi-name>ensaiosDS</jndi-name>

              <isSameRM-override-value>false</isSameRM-override-value>

              <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/ensaios</xa-datasource-property>

               <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

               <user-name>root</user-name>

              <password>123456</password>       

              <track-connection-by-tx>true</track-connection-by-tx>

              <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

              <max-pool-size>20</max-pool-size>

              <min-pool-size>5</min-pool-size>

            <metadata>

               <type-mapping>mySQL</type-mapping>

            </metadata>

         </xa-datasource>

       

      - Ambulatorio-ds.xml

       

      <xa-datasource>

            <jndi-name>ambulatorioDS</jndi-name>

              <isSameRM-override-value>false</isSameRM-override-value>

              <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>

               <xa-datasource-property name="DatabaseName">ambulatorio_30_04_10</xa-datasource-property>

              <xa-datasource-property name="PortNumber">1433</xa-datasource-property>

              <xa-datasource-property name="ServerName">192.168.0.6</xa-datasource-property>      

               <user-name>ensaios</user-name>

              <password>123456</password>

              <track-connection-by-tx>true</track-connection-by-tx>

              <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

              <max-pool-size>20</max-pool-size>

              <min-pool-size>5</min-pool-size>

            <metadata>

               <type-mapping>MS SQLSERVER</type-mapping>

            </metadata>

         </xa-datasource>

       

       

      The error:

       

      03:00:38,695 WARN  [SECURITY] Processing exception 'VDB "ensaiosTeiid" version "latest" does not exist.' for session null.  Exception type org.teiid.client.security.LogonException thrown from org.teiid.services.SessionServiceImpl.getActiveVDB(SessionServiceImpl.java:231). Enable more detailed logging to see the entire stacktrace.

      03:00:38,730 SEVERE [jdbc] Could not create connection

      03:00:38,473 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource

      03:00:38,695 WARN  [SECURITY] Processing exception 'VDB "ensaiosTeiid" version "latest" does not exist.' for session null.  Exception type org.teiid.client.security.LogonException thrown from org.teiid.services.SessionServiceImpl.getActiveVDB(SessionServiceImpl.java:231). Enable more detailed logging to see the entire stacktrace.

      03:00:38,730 SEVERE [jdbc] Could not create connection

      [ConnectionException]VDB "ensaiosTeiid" version "latest" does not exist.

      1 [LogonException]VDB "ensaiosTeiid" version "latest" does not exist.

      2 [SessionServiceException]VDB "ensaiosTeiid" version "latest" does not exist.

          at org.teiid.net.socket.SocketServerConnection.selectServerInstance(SocketServerConnection.java:141)

          at org.teiid.net.socket.SocketServerConnection.<init>(SocketServerConnection.java:94)

          at org.teiid.net.socket.SocketServerConnectionFactory.getConnection(SocketServerConnectionFactory.java:312)

          at org.teiid.jdbc.SocketProfile.createConnection(SocketProfile.java:104)

          at org.teiid.jdbc.SocketProfile.connect(SocketProfile.java:88)

          at org.teiid.jdbc.TeiidDriver.connect(TeiidDriver.java:87)

          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:207)

          at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:195)

          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:633)

          at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:267)

          at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:622)

          at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:404)

          at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:381)

          at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:496)

          at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:941)

          at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:89)

          at org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider.getConnection(InjectedDataSourceConnectionProvider.java:46)

          at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:111)

          at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)

          at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:669)

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:132)

          at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)

          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:597)

          at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)

          at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)

          at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)

          at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)

          at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)

          at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221)

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)

          at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)

          at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)

          at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)

          at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)

          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:121)

          at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:51)

          at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)

          at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)

          at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)

          at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)

          at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)

          at org.jboss.system.server.profileservice.repository.ProfileDeployAction.install(ProfileDeployAction.java:70)

          at org.jboss.system.server.profileservice.repository.AbstractProfileAction.install(AbstractProfileAction.java:53)

          at org.jboss.system.server.profileservice.repository.AbstractProfileService.install(AbstractProfileService.java:361)

          at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)

          at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)

          at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)

          at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)

          at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)

          at org.jboss.system.server.profileservice.repository.AbstractProfileService.activateProfile(AbstractProfileService.java:306)

          at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:271)

          at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:461)

          at org.jboss.Main.boot(Main.java:221)

          at org.jboss.Main$1.run(Main.java:556)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: [LogonException]VDB "ensaiosTeiid" version "latest" does not exist.

      1 [SessionServiceException]VDB "ensaiosTeiid" version "latest" does not exist.

          at org.teiid.transport.LogonImpl.logon(LogonImpl.java:91)

          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:597)

          at org.teiid.transport.ServerWorkItem.run(ServerWorkItem.java:81)

          at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:188)

          at org.teiid.transport.SocketClientInstance.processMessagePacket(SocketClientInstance.java:160)

          at org.teiid.transport.SocketClientInstance.receivedMessage(SocketClientInstance.java:149)

          at org.teiid.transport.SSLAwareChannelHandler.messageReceived(SSLAwareChannelHandler.java:210)

          at org.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:100)

          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

          at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

          at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream(ChunkedWriteHandler.java:144)

          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

          at org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:754)

          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:302)

          at org.jboss.netty.handler.codec.frame.FrameDecoder.unfoldAndFireMessageReceived(FrameDecoder.java:317)

          at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:299)

          at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216)

          at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)

          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:545)

          at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:540)

          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)

          at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)

          at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)

          at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:281)

          at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:201)

          at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)

          at org.jboss.netty.util.internal.IoWorkerRunnable.run(IoWorkerRunnable.java:46)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          ... 1 more

      Caused by: [SessionServiceException]VDB "ensaiosTeiid" version "latest" does not exist.

          at org.teiid.services.SessionServiceImpl.getActiveVDB(SessionServiceImpl.java:231)

          at org.teiid.services.SessionServiceImpl.createSession(SessionServiceImpl.java:159)

          at org.teiid.transport.LogonImpl.logon(LogonImpl.java:76)

          ... 32 more

        • 1. Problem using Jboss Seam and Teiid: version "latest" does not exist
          Steven Hawkins Master

          Hi Gelson,

           

          You'll want to look earlier in the logs to see what the startup status was for ensaiosTeiid.  There should be something like

           

          VDB "enaiosTeiid.1" deployed in {active|inactive} state

           

          That should give you an idea as to why you can't later make a connection or if there is some other issue.

           

          Also since you are making connections locally, you'll also want to use an embedded rather than a socket connection:

           

          <connection-url>jdbc:teiid:ensaiosTeiid</connection-url>

           

          Steve

          • 2. Problem using Jboss Seam and Teiid: version "latest" does not exist
            Gelson Perim Newbie

            Hi Steven,

             

            I'm trying new things here and I realized that the application of seam rises before the vdb. vdb is the last to "deploy" . So if I start JBOSS with VDB and then explode application, do not get this error.

             

            but still my application does not work. I can read the data and list on the screen.

             

            but when I try to Insert I get this error in console:


            12:01:57,404 ERROR [TableGenerator] could not read a hi value org.teiid.jdbc.TeiidSQLException: Group does not exist: hibernate_unique_key

             

            and even more when I try to Update, I get a flash message from SEAM in the screen: "Transaction Failed"... and only!

             

            will that my ds is wrong??

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE datasources

                PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"

                "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

            <datasources>

            <local-tx-datasource>

              <jndi-name>ensaiosDatasource</jndi-name>

              <use-java-context>false</use-java-context>

              <connection-url>jdbc:teiid:ensaiosTeiid@mm://localhost:31000</connection-url>

              <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>

              <user-name>user</user-name>

              <password>user</password>

            </local-tx-datasource>

            </datasources>

             

            I'm a little tired...

             

            thanx.

            • 3. Problem using Jboss Seam and Teiid: version "latest" does not exist
              Steven Hawkins Master

              Gelson,

               

              That is an interesting loading issue.  The load order for vdbs is currently set at 3001 to be just after DataSources.  I don't think we have it explicitly in the docs, but this means that any locally connecting DataSource will have a problem if the min pool size is greater than 0.  That doesn't appear to be your issue though as your Teiid DataSource should be at the default size of 0.

               

              I'm not sure what if that implies there is relative load order problem with Seam specifically.

               

              As for the "hibernate_unique_key" error, I'm not sure why you would get that with the generation method set as idendity.  Currently Teiid does not support identity based generation as we don't return generated keys.  If it's defaulting to the native table strategy, or if you want to use the table strategy then you should update your vdb to expose a hibernate_unique_key with a next_hi column.

               

              Steve

              • 4. Re: Problem using Jboss Seam and Teiid: version "latest" does not exist
                Gelson Perim Newbie

                Steve,

                I'm having problems with <TEIID>. I created the VDB, I connected the Squirrel and tested complex joins between DBs and I was happy with the performance. But happiness is ending because I can not work with "Seam Applications.
                Maybe the problem is in JTA. Specifically the method "persist" gives error, but without exception message. I can not run flush method.

                you do not happen to have an "example data source"using Seam and <Teiid>? I am 3 days looking for something that works ... and nothing!

                I imagined it was this simple: (step by step)

                1 - create the VDB and XMI using Eclipse with "<Teiid> Design"

                • ensaiosMySql.xmi
                • ambulatorioSqlServer.xmi
                • ensaiosTeiid.vdb


                2 - Create the data source of the first DB

                • Ensaios-ds.xml (read/Write)

                 

                   <xa-datasource>
                      <jndi-name>ensaiosDS</jndi-name>
                        <isSameRM-override-value>false</isSameRM-override-value>
                        <xa-datasource-property name="URL">jdbc:mysql://localhost:3306/ensaios</xa-datasource-property>
                         <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>
                         <user-name>root</user-name>
                        <password>123456</password>        
                        <track-connection-by-tx>true</track-connection-by-tx>
                        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                        <max-pool-size>20</max-pool-size>
                        <min-pool-size>5</min-pool-size>
                      <metadata>
                         <type-mapping>mySQL</type-mapping>
                      </metadata>
                   </xa-datasource>
                

                 

                3 - Create a data source for the second DB

                • Ambulatorio-ds.xml (readonly)

                 

                   <xa-datasource>
                      <jndi-name>ambulatorioDS</jndi-name>
                        <isSameRM-override-value>false</isSameRM-override-value>
                        <xa-datasource-class>net.sourceforge.jtds.jdbcx.JtdsDataSource</xa-datasource-class>
                         <xa-datasource-property name="DatabaseName">ambulatorio_30_04_10</xa-datasource-property>
                        <xa-datasource-property name="PortNumber">1433</xa-datasource-property>
                        <xa-datasource-property name="ServerName">192.168.0.6</xa-datasource-property>
                         <user-name>root</user-name>
                        <password>123456</password> 
                        <track-connection-by-tx>true</track-connection-by-tx>
                        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                        <max-pool-size>20</max-pool-size>
                        <min-pool-size>5</min-pool-size>
                      <metadata>
                         <type-mapping>MS SQLSERVER</type-mapping>
                      </metadata>
                   </xa-datasource>
                

                 

                4 - Make deploy the VDB in Jboss 5.1.0.GA

                 

                5 - Finaly, configure seam project:

                • persistence-dev.xml

                 

                   <persistence-unit name="ensaios" transaction-type="JTA">
                      <provider>org.hibernate.ejb.HibernatePersistence</provider>
                      <jta-data-source>ensaiosDatasource</jta-data-source>
                      <properties>
                         <property name="hibernate.dialect" value="org.teiid.dialect.TeiidDialect"/>
                         <property name="hibernate.hbm2ddl.auto" value="update"/>
                         <property name="hibernate.show_sql" value="true"/>
                         <property name="hibernate.format_sql" value="false"/>
                         <!-- Only relevant if Seam is loading the persistence unit (Java SE bootstrap) -->
                        <property name="hibernate.transaction.manager_lookup_class" value="@transactionManagerLookupClass@"/>
                      </properties>
                   </persistence-unit>
                

                 

                • ensaios-dev-ds.xml

                 

                <datasources>
                 <local-tx-datasource>
                  <jndi-name>ensaiosDatasource</jndi-name>
                  <use-java-context>false</use-java-context>
                  <connection-url>jdbc:teiid:ensaios@mm://localhost:31000</connection-url>
                  <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
                  <user-name>user</user-name>
                  <password>user</password>
                   <min-pool-size>5</min-pool-size>
                   <max-pool-size>20</max-pool-size>
                 </local-tx-datasource>
                </datasources>
                

                 

                • components-dev.xml

                 

                 <persistence:managed-persistence-context  name="entityManager"
                                                       persistence-unit-jndi-name="java:comp/env/ensaios/pu"
                                                     auto-create="true"/>
                

                 

                • a mapped class

                 

                import javax.persistence.Entity;
                import javax.persistence.GeneratedValue;
                import javax.persistence.GenerationType;
                import javax.persistence.Id;
                import javax.persistence.Version;
                
                @Entity
                public class Papel {
                
                    @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
                    private Long id;
                
                    @Version
                    private Long versao;
                
                    private String Nome;
                

                 

                I can't commit, AutoIncrement ID.

                 

                Sorry for the large text. But I need help!

                 

                thanx.

                 

                Gelson

                • 5. Re: Problem using Jboss Seam and Teiid: version "latest" does not exist
                  Gelson Perim Newbie

                  Hello Steve,

                  could solve the problem with JBoss Seam. The solution was put annotation in the IDs "
                  @Id @GeneratedValue(strategy=GenerationType.TABLE)" and create the table hibernate_sequence. As described below:

                   

                  Create table:


                  CREATE TABLE  `bd`.`hibernate_sequences` (
                    `sequence_name` varchar(255) DEFAULT NULL,
                    `sequence_next_hi_value` int(11) DEFAULT NULL
                  ) ENGINE=MyISAM DEFAULT CHARSET=latin1
                  

                   

                  Change the Id annotation of the Entity:

                   

                  @Entity
                  public class Papel {
                  
                      @Id @GeneratedValue(strategy=GenerationType.TABLE)
                      private Long id;
                  
                      @Version
                      private Long versao;
                  
                      private String Nome;
                  

                   

                  And finally (very important ): Add the table "hibernate_sequences" to your VDB.

                   

                  The other stuff stays the same.

                   

                  Thank you for your attention. (Obrigado)

                   

                  Gelson

                  • 6. Re: Problem using Jboss Seam and Teiid: version "latest" does not exist
                    Steven Hawkins Master

                    Gelson,

                     

                    That's good you got it working.  I updated the client developer section on Hibernate to add more information about id generation.

                     

                    You should also update your teiid datasource to be:

                     

                    <datasources>
                    <local-tx-datasource>
                      <jndi-name>ensaiosDatasource</jndi-name>
                      <use-java-context>false</use-java-context>
                      <connection-url>jdbc:teiid:ensaios</connection-url>
                      <driver-class>org.teiid.jdbc.TeiidDriver</driver-class>
                      <user-name>user</user-name>
                      <password>user</password>
                       <max-pool-size>20</max-pool-size>
                    </local-tx-datasource>
                    </datasources>

                    Having the no zero min pool size was probably causing the load issue you saw and there is no need to use a socket connection.   The docs were also updated to highlight these considerations.

                     

                    Thanks,

                    Steve

                    1 of 1 people found this helpful
                    • 7. Re: Problem using Jboss Seam and Teiid: version "latest" does not exist
                      Gelson Perim Newbie

                      Hi Steve,

                       

                      I'll update the pool. Can I use the C3P0's pool normally?

                       

                      Thanks,

                       

                      Gelson

                      • 8. Re: Problem using Jboss Seam and Teiid: version "latest" does not exist
                        Steven Hawkins Master

                        If you are deploying in JBoss AS, there's no need to use C3P0.  That said, the TeiidDriver/TeiidDataSource don't care what connection pool you use.  If the pool and Teiid are in the same VM, the same suggestion of bypassing the socket transport by using a local connection would hold.

                         

                        Steve