Unable to save Gliffy diagram - hibernateOptimisticLockingFailureException
Asked by Cato Jensen:

Environment:  
\*Confluence Server Version: 7.4.15  
\*Gliffy for Confluence Server Version: 9.1.2

<br />

When editing an existing gliffy diagram, the filename reads "untitled". In addition, when trying to save, the user have to specify a (new) filename for the gliffy. When trying to save, the following error occurs:

Object of class \[java.lang.Object\] with identifier \[null\]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1\</message\>\<stack-trace\>org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class \[java.lang.Object\] with identifier \[null\]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1

This error seems to have appeared after the last upgrade of Confluence to v.7.4.15 (only minor upgrade). It seems to affect all Gliffy that has been created. New Gliffy drawings behaves correctly.

Does anybody know why this is happening? This is critical and blocking, but I get no answers from Gliffy/Perforce.

Enabled SQL Logging in Confluence Aadministration page. This is parts of the atlassian-confluence.log-output that is the last and therefore most valuable information before the error message pops up:

2022-05-09 17:17:47,464 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement select contentent0_.CONTENTID as CONTENTI1_12_, contentent0_.HIBERNATEVERSION as HIBERNAT2_12_, contentent0_.TITLE as TITLE4_12_, contentent0_.LOWERTITLE as LOWERTIT5_12_, contentent0_.VERSION as VERSION6_12_, contentent0_.CREATOR as CREATOR7_12_, contentent0_.CREATIONDATE as CREATION8_12_, contentent0_.LA  
STMODIFIER as LASTMODI9_12_, contentent0_.LASTMODDATE as LASTMOD10_12_, contentent0_.VERSIONCOMMENT as VERSION11_12_, contentent0_.PREVVER as PREVVER12_12_, contentent0_.CONTENT_STATUS as CONTENT13_12_, contentent0_.PAGEID as PAGEID14_12_, contentent0_.SPACEID as SPACEID15_12_, contentent0_.CHILD_POSITION as CHILD_P16_12_, contentent0_.PARENTID as PARENTI17_12_, contentent0_.PLUGINKEY as PLU  
GINK18_12_, contentent0_.PLUGINVER as PLUGINV19_12_, contentent0_.PARENTCCID as PARENTC20_12_, contentent0_.DRAFTPAGEID as DRAFTPA21_12_, contentent0_.DRAFTSPACEKEY as DRAFTSP22_12_, contentent0_.DRAFTTYPE as DRAFTTY23_12_, contentent0_.DRAFTPAGEVERSION as DRAFTPA24_12_, contentent0_.PARENTCOMMENTID as PARENTC25_12_, contentent0_.USERNAME as USERNAM26_12_, contentent0_.CONTENTTYPE as CONTENT  
T3_12_ from CONTENT contentent0_ where contentent0_.CONTENT_STATUS='draft' and (contentent0_.PREVVER=? or contentent0_.CONTENTID=? and (contentent0_.PREVVER is null)) order by contentent0_.CREATIONDATE desc, contentent0_.CONTENTID desc  
2022-05-09 17:17:47,464 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[BIGINT\] - \[149760494\]  
2022-05-09 17:17:47,465 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[BIGINT\] - \[149760494\]  
2022-05-09 17:17:47,466 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicExtractor\] extract extracted value (\[CONTENTI1_12_\] : \[BIGINT\]) - \[149760497\]  
2022-05-09 17:17:47,472 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement insert into IMAGEDETAILS (HEIGHT, WIDTH, MIMETYPE, ATTACHMENTID) values (?, ?, ?, ?)  
2022-05-09 17:17:47,473 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[INTEGER\] - \[1006\]  
2022-05-09 17:17:47,473 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[INTEGER\] - \[1068\]  
2022-05-09 17:17:47,474 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[image/png\]  
2022-05-09 17:17:47,474 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[BIGINT\] - \[194642306\]  
2022-05-09 17:17:47,477 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement insert into LINKS (DESTPAGETITLE, LOWERDESTPAGETITLE, DESTSPACEKEY, LOWERDESTSPACEKEY, CONTENTID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, LINKID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  
2022-05-09 17:17:47,477 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[VARCHAR\] - \[Review Summary Front Panel Controller Software Design Description Rev A\]  
2022-05-09 17:17:47,478 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[VARCHAR\] - \[review summary front panel controller software design description rev a\]  
2022-05-09 17:17:47,478 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[HCDU\]  
2022-05-09 17:17:47,479 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[VARCHAR\] - \[hcdu\]  
2022-05-09 17:17:47,479 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[5\] as \[BIGINT\] - \[149760497\]  
2022-05-09 17:17:47,479 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[7\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,480 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[9\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 C  
EST 2022\]  
2022-05-09 17:17:47,481 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[10\] as \[BIGINT\] - \[239724560\]  
2022-05-09 17:17:47,482 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement insert into LINKS (DESTPAGETITLE, LOWERDESTPAGETITLE, DESTSPACEKEY, LOWERDESTSPACEKEY, CONTENTID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, LINKID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  
2022-05-09 17:17:47,483 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[VARCHAR\] - \[SW Releases - FPC\]  
2022-05-09 17:17:47,483 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[VARCHAR\] - \[sw releases - fpc\]  
2022-05-09 17:17:47,484 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[HCDU\]  
2022-05-09 17:17:47,484 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[VARCHAR\] - \[hcdu\]  
2022-05-09 17:17:47,485 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[5\] as \[BIGINT\] - \[149760497\]  
2022-05-09 17:17:47,485 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[7\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,485 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[9\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,486 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[10\] as \[BIGINT\] - \[239724561\]  
2022-05-09 17:17:47,487 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement insert into LINKS (DESTPAGETITLE, LOWERDESTPAGETITLE, DESTSPACEKEY, LOWERDESTSPACEKEY, CONTENTID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, LINKID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  
2022-05-09 17:17:47,487 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[VARCHAR\] - \[//[www.port.de/en/products/canopen/software/canopen-mini-bootloader-paulus.html](http://www.port.de/en/products/canopen/software/canopen-mini-bootloader-paulus.html)\]  
2022-05-09 17:17:47,488 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[VARCHAR\] - \[//[www.port.de/en/products/canopen/software/canopen-mini-bootloader-paulus.html](http://www.port.de/en/products/canopen/software/canopen-mini-bootloader-paulus.html)\]  
2022-05-09 17:17:47,488 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[https\]  
2022-05-09 17:17:47,488 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[VARCHAR\] - \[https\]  
2022-05-09 17:17:47,489 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[5\] as \[BIGINT\] - \[149760497\]  
2022-05-09 17:17:47,489 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[7\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,489 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[9\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,490 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[10\] as \[BIGINT\] - \[239724562\]  
2022-05-09 17:17:47,491 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement insert into LINKS (DESTPAGETITLE, LOWERDESTPAGETITLE, DESTSPACEKEY, LOWERDESTSPACEKEY, CONTENTID, CREATOR, CREATIONDATE, LASTMODIFIER, LASTMODDATE, LINKID) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)  
2022-05-09 17:17:47,491 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[VARCHAR\] - \[//confluence.datarespons.com/pages/viewpage.action?pageId=141697208\]  
2022-05-09 17:17:47,492 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[VARCHAR\] - \[//confluence.datarespons.com/pages/viewpage.action?pageid=141697208\]  
2022-05-09 17:17:47,492 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[https\]  
2022-05-09 17:17:47,492 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[VARCHAR\] - \[https\]  
2022-05-09 17:17:47,493 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[5\] as \[BIGINT\] - \[149760497\]  
2022-05-09 17:17:47,493 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[7\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,493 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[9\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,494 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[10\] as \[BIGINT\] - \[239724563\]  
2022-05-09 17:17:47,495 DEBUG \[http-nio-8090-exec-15\] \[org.hibernate.SQL\] logStatement update CONTENT set HIBERNATEVERSION=?, TITLE=?, LOWERTITLE=?, VERSION=?, CREATOR=?, CREATIONDATE=?, LASTMODIFIER=?, LASTMODDATE=?, VERSIONCOMMENT=?, PREVVER=?, CONTENT_STATUS=?, PAGEID=?, SPACEID=?, CHILD_POSITION=?, PARENTID=? where CONTENTID=? and HIBERNATEVERSION=?  
2022-05-09 17:17:47,495 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[1\] as \[INTEGER\] - \[1538\]  
2022-05-09 17:17:47,496 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[2\] as \[VARCHAR\] - \[Front Panel Controller Software Design Description\]  
2022-05-09 17:17:47,496 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[3\] as \[VARCHAR\] - \[front panel controller software design description\]  
2022-05-09 17:17:47,496 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[4\] as \[INTEGER\] - \[1\]  
2022-05-09 17:17:47,497 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[6\] as \[TIMESTAMP\] - \[2020-04-27 15:30:51.447\]  
2022-05-09 17:17:47,497 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[8\] as \[TIMESTAMP\] - \[Mon May 09 17:17:47 CEST 2022\]  
2022-05-09 17:17:47,497 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[10\] as \[BIGINT\] - \[149760494\]  
2022-05-09 17:17:47,498 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[11\] as \[VARCHAR\] - \[draft\]  
2022-05-09 17:17:47,498 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[12\] as \[BIGINT\] - \[null\]  
2022-05-09 17:17:47,499 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[13\] as \[BIGINT\] - \[124682241\]  
2022-05-09 17:17:47,500 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[14\] as \[INTEGER\] - \[null\]  
2022-05-09 17:17:47,500 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[15\] as \[BIGINT\] - \[null\]  
2022-05-09 17:17:47,500 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[16\] as \[BIGINT\] - \[149760497\]  
2022-05-09 17:17:47,501 TRACE \[http-nio-8090-exec-15\] \[type.descriptor.sql.BasicBinder\] bind binding parameter \[17\] as \[INTEGER\] - \[1537\]  
2022-05-09 17:17:47,503 ERROR \[http-nio-8090-exec-15\] \[org.hibernate.internal.ExceptionMapperStandardImpl\] mapManagedFlushFailure HHH000346: Error during managed flush \[Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1\]  
-- referer: [https://confluence.datarespons.com/plugins/gliffy/editor.action?ceoid=149760494\&inline=true\&pageId=149760494\&attachmentVersion=0\&originalAttachmentVersion=0\&isPinned=false\&wootric=undefined\&name=FPC%20PWRCTRL%20FSM\&displayName=FPC%20PWRCTRL%20FSM](https://confluence.datarespons.com/plugins/gliffy/editor.action?ceoid=149760494&inline=true&pageId=149760494&attachmentVersion=0&originalAttachmentVersion=0&isPinned=false&wootric=undefined&name=FPC%20PWRCTRL%20FSM&displayName=FPC%20PWRCTRL%20FSM) \| url: /rest/gliffy/1.0/diagrams/194642305 \| traceId: f53c3e553575cf37 \| userName: om  
2022-05-09 17:17:47,505 WARN \[http-nio-8090-exec-15\] \[net.sf.hibernate.StaleObjectStateException\] \<init\> An operation failed due to stale data  
-- referer: [https://confluence.datarespons.com/plugins/gliffy/editor.action?ceoid=149760494\&inline=true\&pageId=149760494\&attachmentVersion=0\&originalAttachmentVersion=0\&isPinned=false\&wootric=undefined\&name=FPC%20PWRCTRL%20FSM\&displayName=FPC%20PWRCTRL%20FSM](https://confluence.datarespons.com/plugins/gliffy/editor.action?ceoid=149760494&inline=true&pageId=149760494&attachmentVersion=0&originalAttachmentVersion=0&isPinned=false&wootric=undefined&name=FPC%20PWRCTRL%20FSM&displayName=FPC%20PWRCTRL%20FSM) \| url: /rest/gliffy/1.0/diagrams/194642305 \| traceId: f53c3e553575cf37 \| userName: om  
net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1  
at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptStaleObjectStateException(HibernateExceptionAdapter.java:580)  
at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptOptimisticLockException(HibernateExceptionAdapter.java:551)  
at com.atlassian.hibernate.adapter.adapters.HibernateExceptionAdapter.adaptImpl(HibernateExceptionAdapter.java:102)


Answers:
author: Samie Kaufman - Your Gal at Gliffy
body: Hi Cato!  

I checked in with our support team and it looks like they didn't get a response with the additional information they requested about two weeks ago.

Would you please open another support case for this issue here so that they can help: <https://www.perforce.com/support/request-support>

Thanks so much!

Samie


Tags: confluence-server

gliffy

server