1 Reply Latest reply on Jan 19, 2004 10:39 PM by ebaskoro

    Insert / Delete during EJB Deploy and read-only data source

    richaosu

      I'm using JBoss 3.2.3. During deployment, how can I suppress INSERTs and DELETEs for read-only tables and datasources?

      During deployment, the CMP engine invokes JDBCCreateEntityCommand to perform an SQL INSERT / COUNT / DELETE sequence. I need to bind to a reporting database which the DBA's have made SELECT only (no INSERT, UPDATE DELETE or CREATE privledges). The reporting database is configured as read-only for business reasons.

      My entities fail to deploy, the ERROR message is:

      org.jboss.deployment.DeploymentException:Error while checking if table aleady exists; - nested throwable: (java.sql.SQL Exception: Could not open or create a temporary file.)

      I have declared each entity as read-only (<read-only>true</read-only>)in jbosscmp-jdbc.xml but the INSERT / COUNT / DELETE sequence continues to occur.

        • 1. Re: Insert / Delete during EJB Deploy and read-only data sou
          ebaskoro

          G'Day,

          You can turn off the table autogenerate and autoremove options by specifying them in jbosscmp-jdbc.xml

          <jbosscmp-jdbc>
          ...
          <enterprise-beans>
          ...

          <ejb-name>User</ejb-name>
          java:/DB
          <datasource-mapping>Oracle9i</datasource-mapping>
          <create-table>false</create-table>
          <remove-table>false</remove-table>
          <table-name>UserTable</table-name>
          ...

          ...
          </enterprise-beans>
          ..
          </jbosscmp-jdbc>