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:
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.