Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1051487

Summary: Multiple failures with Oracle DB schema as configured with installer - value too large for column (re-opened)
Product: [JBoss] JBoss Fuse Service Works 6 Reporter: Pavel Macik <pmacik>
Component: InstallerAssignee: Julian Coleman <jcoleman>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Macik <pmacik>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.0.0 GACC: atangrin, jcoleman, jsedlace, psrna, soa-p-jira
Target Milestone: CR1Keywords: Regression
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Server log
none
another-server-log.txt none

Description Pavel Macik 2014-01-10 12:09:38 UTC
Created attachment 848153 [details]
Server log

When server (with Oracle DS) starts it generates several SQL errors such as:

- ORA-12899: value too large for column "SOAESB1"."ispn_bucket_sramp"."DATUM" (actual: 2123, maximum: 2000)

- ORA-01461: can bind a LONG value only for insert into a LONG column

Steps to reproduce:

1.) install FSW using provided installer with out-of-the-box options + Oracle datasource installed (with ojdbc6.jar driver) into $FSW directory

2.) clean DB

3.) use following command to initiate DB schema:

$ ant -f $FSW/sql/build.xml-Ddriverjarloc=$FSW/modules/oracle/jdbc/main
-Ddb.driver=oracle.jdbc.driver.OracleDriver
-Ddb.url=jdbc:oracle:thin:@DB_HOST:1521:$DB_NAME -Ddb.user=$DB_USER
-Ddb.password=$DB_PASS -Ddb.dialect=Oracle10gDialect

Note: this causes following issue (https://bugzilla.redhat.com/show_bug.cgi?id=1051464) - maybe related

4.) start the server

5.) wait ~30s after the "server started" log message

See the attached full server log.

Comment 1 Pavel Macik 2014-01-10 12:11:24 UTC
The issue is introduced in 6.0.0.ER8 build

Comment 3 Len DiMaggio 2014-01-10 13:23:33 UTC
Regression - not seen in ER7

Comment 5 Julian Coleman 2014-01-10 13:44:05 UTC
This looks like it is probably fixed in the community by:

  https://github.com/Governance/s-ramp/pull/328

(SRAMP-241) which explicitly configures the Infinispan tables.

For the product, an AS CLI script to add this configuration is required.

Comment 6 Len DiMaggio 2014-01-10 13:53:45 UTC
Is this problem unique to Oracle?

In MySQL 5.5 seeing this:

mysql> describe ispn_bucket_sramp;
+---------+------------------+------+-----+---------+-------+
| Field   | Type             | Null | Key | Default | Extra |
+---------+------------------+------+-----+---------+-------+
| id      | varchar(500)     | NO   | PRI | NULL    |       |
| datum   | varbinary(60000) | YES  |     | NULL    |       |
| version | bigint(20)       | YES  |     | NULL    |       |
+---------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

Comment 7 Pavel Macik 2014-01-10 14:15:18 UTC
The server configuration contains following cache configuration where the "datum" column is set to 2000 in case of Oracle but 60000 in case of MySQL.

Oracle:
...
<cache-container name="modeshape">
  <local-cache name="sramp">
    <locking isolation="NONE"/>
    <transaction mode="NON_XA"/>
    <string-keyed-jdbc-store datasource="java:jboss/datasources/srampDS" passivation="false" purge="false">
      <string-keyed-table prefix="ispn_bucket">
        <id-column name="id" type="varchar2(500 char)"/>
        <data-column name="datum" type="raw(2000)"/>
        <timestamp-column name="version" type="number(19,0)"/>
      </string-keyed-table>
    </string-keyed-jdbc-store>
  </local-cache>
</cache-container>
...

MySQL:
...
<cache-container name="modeshape">
  <local-cache name="sramp">
    <locking isolation="NONE"/>
    <transaction mode="NON_XA"/>
    <string-keyed-jdbc-store datasource="java:jboss/datasources/srampDS" passivation="false" purge="false">
      <string-keyed-table prefix="ispn_bucket">
        <id-column name="id" type="VARCHAR(500)"/>
        <data-column name="datum" type="VARBINARY(60000)"/>
        <timestamp-column name="version" type="BIGINT"/>
      </string-keyed-table>
    </string-keyed-jdbc-store>
  </local-cache>
</cache-container>
...

Comment 8 Julian Coleman 2014-01-10 16:41:27 UTC
Fixed with commit 25a440ddfb9c28a5d38bc4b0de221d4d4c56cac0 to ip (6.0.0-fsw branch):

  BZ-1051487
  Replace raw(2000) with blob, as we store data larger than 2000 bytes.

Comment 9 Pavol Srna 2014-01-16 09:34:43 UTC
I don't see the original issues reported, but maybe something new was introduced?

This is my log:

javax.persistence.PersistenceException: [PersistenceUnit: gadget-core] Unable to build EntityManagerFactory
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:103)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
	at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122)
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: gadget-core] Unable to build EntityManagerFactory
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:930)
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
	at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:92)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57)
	at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99)
	... 4 more
Caused by: org.hibernate.HibernateException: Missing sequence or table: hibernate_sequence
	at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1289)
	at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:155)
	at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:508)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1762)
	at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
	at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
	... 9 more

Comment 10 Pavol Srna 2014-01-16 09:36:04 UTC
Created attachment 850953 [details]
another-server-log.txt

Comment 11 Julian Coleman 2014-01-17 12:45:26 UTC
I can't reproduce this.  The hibernate_sequence is created correctly, and the server starts without errors.
(tested using oracle11gR2 via DBALLO01)

Comment 12 Pavol Srna 2014-01-17 13:02:33 UTC
I can't reproduce either. I'll reopen or file another bug if seen in the future.