Bug 1121220 - Plugins with large description text for measurement def. cause ORA-12899
Summary: Plugins with large description text for measurement def. cause ORA-12899
Keywords:
Status: ON_QA
Alias: None
Product: RHQ Project
Classification: Other
Component: Plugins
Version: 4.12
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: GA
: RHQ 4.13
Assignee: Jay Shaughnessy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-18 16:46 UTC by Elias Ross
Modified: 2022-03-31 04:28 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Elias Ross 2014-07-18 16:46:55 UTC
Description of problem:

When deploying a plugin with a long description for a measurement, I saw this:

Caused by: java.sql.BatchUpdateException: ORA-12899: value too large for column "RHQ"."RHQ_MEASUREMENT_DEF"."DESCRIPTION" (actual: 565, maximum: 500)

	at oracle.jdbc.driver.OraclePreparedStatement.executeBatch(OraclePreparedStatement.java:10296) [ojdbc6-12.1.0.1.0.jar:11.2.0.2.0]
	at oracle.jdbc.driver.OracleStatementWrapper.executeBatch(OracleStatementWrapper.java:216) [ojdbc6-12.1.0.1.0.jar:11.2.0.2.0]
	at org.jboss.jca.adapters.jdbc.CachedPreparedStatement.executeBatch(CachedPreparedStatement.java:708)
	at org.jboss.jca.adapters.jdbc.WrappedStatement.executeBatch(WrappedStatement.java:1077)
	at org.hibernate.engine.jdbc.batch.internal.BatchingBatch.performExecution(BatchingBatch.java:113) [hibernate-core-4.2.10.Final.jar:4.2.10.Final]
	... 421 more

RHQ should truncate the text to fit.

<metric property="cachePercentByteHit" description="Cache byte hit ratio expressed as percentage. Here we define byte hit ratio as ((number of bytes ... etc."/>

Version-Release number of selected component (if applicable): 4.12


How reproducible: Always


Steps to Reproduce:
1. Create plugin with description text > 500 characters
2. Deploy plugin

Actual results: Exception


Expected results: No error. Actually not 100% sure if truncation is always good or not, but better than the plugin not deploying in most cases.


Additional info:

Comment 1 Jay Shaughnessy 2014-07-18 21:15:36 UTC
master commit b7444d06129984ce2d07066b9ed60b826e2dc6e1
Author: Jay Shaughnessy <jshaughn>
Date:   Fri Jul 18 17:12:47 2014 -0400

    as far as I know we don't have a general mechanism for truncating on max
    length constraints.  So this is just a point solution for this BZ.  Before
    storing to the DB, ensure length constraints are met.


Note You need to log in before you can comment on or make changes to this bug.