[opencms-dev] CmsDbSqlException

Konstantin Ott konstantin.ott at albertbauer.com
Wed Jun 16 18:12:16 CEST 2010


OK i've got it:
our jdbc connection String was configured with the parameter 
"useCompression=true"
Without compression everything seems ok:

http://bugs.mysql.com/bug.php?id=48346

greetings

Am 10.06.2010 15:17, schrieb Konstantin Ott:
> we're using the OCEE Modul, which enables Transactions with InnoDB.
> But the problem started as we updated Mysql and not only happens with
> OCEE classes.  I guess the problem appears in Connectionpool.
> Has anybody experienced such problems with mysql  5.1.45? How about
> configuration params of pool and my.cnf?
>
> Am 10.06.2010 10:01, schrieb Claus Priisholm:
>    
>> I am using a different test SQL statement, but it should no matter as
>> long as the connection gets tested.
>>
>> I am not sure about the cause "Lock wait timeout exceeded; try
>> restarting transaction" - this would suggest that something is messed up
>> in relation to a transaction - perhaps a connection with an unfinished
>> transaction has been returned to the pool. But in a default installation
>> on MySQL there is not much going on as far as transactions goes, The
>> MyISAM backend considers a single statement as a transaction (kind of
>> having autocommit on all the time) so maybe in case of a freaky timing
>> issue or likewise you could run into to it, but I would not think it
>> would be easy to reproduce.
>>
>> The Prepared Statemnt looks a bit weird as well "DELEM" is not a valid
>> SQL command as far as I know, but it could just be your cut'n'pase that
>> caused it.
>>
>> /Claus
>>
>>
>>
>> Konstantin Ott wrote:
>>
>>      
>>> these params were set:
>>> db.pool.default.testOnBorrow=true
>>> db.pool.default.testQuery=/* ping */ SELECT 1
>>>
>>> and I've got another CmsDbSqlException:
>>>
>>> Caused by: org.opencms.db.CmsDbSqlException: An SQL error occurred when
>>> executing the following query:
>>> com.mysql.jdbc.PreparedStatement at 45bc00e4: DELEM CMS_ONLINE_PROPERTIES
>>> WHERE (PROPERTY_MAPPING_ID='be622085-3d89-11df-af26-68bdd7447ccc' AND
>>> PROPERTY_MAPPING_TYPE=2) OR
>>> (PROPERTY_MAPPING_ID='be62209-11df-af26-68bdd7447ccc' AND
>>> PROPERTY_MAPPING_TYPE=1).
>>>            at
>>> org.opencms.db.generic.CmsVfsDriver.deletePropertyObjects(CmsVfsDriver.java:939)
>>>
>>>            at
>>> org.opencms.ocee.cache.CmsVfsCache.deletePropertyObjects(CmsVfsCache.java:247)
>>>
>>>            at
>>> org.opencms.db.generic.CmsProjectDriver.publishChangedFile(CmsProjectDriver.java:2717)
>>>
>>>            at
>>> org.opencms.db.generic.CmsProjectDriver.publishFile(CmsProjectDriver.java:964)
>>>
>>>            ... 5 more
>>> Caused by: java.sql.SQLException: Lock wait timeout exceeded; try
>>> restarting transaction
>>>            at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:946)
>>>            at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
>>>            at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
>>>            at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>>>            at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>>>            at
>>> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>>>
>>>            at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1585)
>>>            at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1500)
>>>            at
>>> com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1485)
>>>            at
>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
>>>
>>>            at
>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
>>>
>>>            at
>>> org.opencms.db.generic.CmsVfsDriver.deletePropertyObjects(CmsVfsDriver.java:937)
>>>
>>>
>>>
>>>
>>> Am 09.06.2010 09:55, schrieb Claus Priisholm:
>>>
>>>        
>>>> I am not sure where the problem occurs, but when upgrading involved
>>>> products to fairly new ones (like MySQL 5.1, Java 6 and  OpenCms 7.x) I
>>>> find it necessary to enable testOnBorrow and the related testQuery in
>>>> opencms.properties to avoid unexpected problems.
>>>>
>>>> Konstantin Ott wrote:
>>>>
>>>>
>>>>          
>>>>> Hello list,
>>>>>
>>>>> since a few days we find in the opencms log file SQL Exceptions. It
>>>>> seems to happen when publishing a file.
>>>>> It is not reproducable and the SELECT is ok. There is a lot of load on
>>>>> the system and there is a lot of changing content. But the problem only
>>>>> appeared 2 times last week.
>>>>> OpenCMS seems to loose a connection every now and then. Some time ago we
>>>>> switched the system from Suse-Mysql5.0.51 to Debian-Mysql 5.1.45.
>>>>> I don't know if its the reason.
>>>>> Has anybody got an idea?
>>>>>
>>>>> greetings
>>>>> Konstantin Ott
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> org.opencms.db.CmsDbSqlException: An SQL error occurred when executing
>>>>> the following query: com.mysql.jdbc.PreparedStatement at f22345d: SELECT
>>>>> CMS_OFFLINE_CONTENTS.FILE_CONTENT FROM CMS_OFFLINE_CONTENTS WHERE
>>>>> CMS_OFFLINE_CONTENTS.RESOURCE_ID='99a69fba-bd41-11dc-9d14-69bdd7447ccc'.
>>>>>             at
>>>>> org.opencms.db.generic.CmsVfsDriver.readContent(CmsVfsDriver.java:1468)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsVfsCache.readContent(CmsVfsCache.java:469)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishFileContent(CmsProjectDriver.java:1068)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishFileContent(CmsProjectCache.java:385)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishChangedFile(CmsProjectDriver.java:2760)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishFile(CmsProjectDriver.java:964)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishFile(CmsProjectCache.java:361)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishProject(CmsProjectDriver.java:1455)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishProject(CmsProjectCache.java:421)
>>>>>             at
>>>>> org.opencms.db.CmsDriverManager.publishJob(CmsDriverManager.java:5221)
>>>>>             at
>>>>> org.opencms.publish.CmsPublishThread.run(CmsPublishThread.java:199)
>>>>> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
>>>>> failure due to underlying exception:
>>>>>
>>>>> ** BEGIN NESTED EXCEPTION **
>>>>>
>>>>> java.lang.ArrayIndexOutOfBoundsException
>>>>>
>>>>> STACKTRACE:
>>>>>
>>>>> java.lang.ArrayIndexOutOfBoundsException
>>>>>             at java.lang.System.arraycopy(Native Method)
>>>>>             at
>>>>> com.mysql.jdbc.CompressedInputStream.read(CompressedInputStream.java:281)
>>>>>             at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1994)
>>>>>             at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2464)
>>>>>             at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
>>>>>             at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885)
>>>>>             at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1360)
>>>>>             at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2358)
>>>>>             at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:451)
>>>>>             at
>>>>> com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2076)
>>>>>             at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1451)
>>>>>             at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1787)
>>>>>             at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>>>>>             at
>>>>> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>>>>>             at
>>>>> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
>>>>>             at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>>>>>             at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>>>>>             at
>>>>> org.opencms.db.generic.CmsVfsDriver.readContent(CmsVfsDriver.java:1453)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsVfsCache.readContent(CmsVfsCache.java:469)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishFileContent(CmsProjectDriver.java:1068)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishFileContent(CmsProjectCache.java:385)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishChangedFile(CmsProjectDriver.java:2760)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishFile(CmsProjectDriver.java:964)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishFile(CmsProjectCache.java:361)
>>>>>             at
>>>>> org.opencms.db.generic.CmsProjectDriver.publishProject(CmsProjectDriver.java:1455)
>>>>>             at
>>>>> org.opencms.ocee.cache.CmsProjectCache.publishProject(CmsProjectCache.java:421)
>>>>>             at
>>>>> org.opencms.db.CmsDriverManager.publishJob(CmsDriverManager.java:5221)
>>>>>             at
>>>>> org.opencms.publish.CmsPublishThread.run(CmsPublishThread.java:199)
>>>>>
>>>>>
>>>>> ** END NESTED EXCEPTION **
>>>>>
>>>>>
>>>>>
>>>>> Last packet sent to the server was 2 ms ago.
>>>>>             at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2922)
>>>>>             at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:885)
>>>>>             at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1360)
>>>>>             at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2358)
>>>>>             at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:451)
>>>>>             at
>>>>> com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:2076)
>>>>>             at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1451)
>>>>>             at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1787)
>>>>>             at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>>>>>             at
>>>>> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>>>>>             at
>>>>> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
>>>>>             at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>>>>>             at
>>>>> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>>>>>             at
>>>>> org.opencms.db.generic.CmsVfsDriver.readContent(CmsVfsDriver.java:1453)
>>>>>
>>>>>
>>>>>
>>>>>            
>>>>
>>>>          
>>>
>>>        
>>
>>      
>
>    


-- 
. . . . . . . . . . . . . . . . . . . . . . . .


Konstantin Ott
Albert Bauer Digital | Systementwicklung

Albert Bauer Companies GmbH&  Co. KG
Conventstraße 1 - 3
22089 Hamburg
Fon: +49 40 25109-224
Fax: +49 40 25109-121
mailto:konstantin.ott at albertbauer.com
http://albertbauer.com


Albert Bauer Companies GmbH&  Co. KG
P.H.G. Reproduktionsgesellschaft Conventhaus mbH
Sitz der Gesellschaft: Hamburg
Handelsregister: Amtsgericht Hamburg HRB 11120
Geschäftsführer: Harald Dau, Carsten Dau, Rolf Gehrke, Marcus Müller




More information about the opencms-dev mailing list