SQL Server log file growing till runs out of disk space


#1

We have recently moved our software from Hibernate 3 to Hibernate 5. On running a longish operation the SQL server 2014 database log file is growing rapidly until it runs out of disk space. The process reads 3,200 records from the database in one operation and then loops through these records and reads another record, these two sets of records are then used to create two new records - so 6400 writes. This operation on the version using Hibernate 3 does not affect the size of the log file at all, but using Hibernate 5 it does (using the same VM to run them). On the old version this operation would normally take about 5 minutes to run. On the new version it is taking about 15 and then failing.

This is a small subset of the log for Hibernate 3:-

02-Jul-2018 15:51:52,756 DEBUG - SQL - select this_.ID as ID33_0_, this_.Content as Content33_0_ from tbl_edoc_content this_ where this_.ID=?
02-Jul-2018 15:51:52,756 DEBUG - AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
02-Jul-2018 15:51:52,756 DEBUG - Loader - result row: EntityKey[uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 15:51:52,756 DEBUG - AbstractBatcher - about to close ResultSet (open ResultSets: 1, globally: 1)
02-Jul-2018 15:51:52,756 DEBUG - AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
02-Jul-2018 15:51:52,756 DEBUG - TwoPhaseLoad - resolving associations for [uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 15:51:52,756 DEBUG - TwoPhaseLoad - done materializing entity [uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 15:51:52,756 DEBUG - StatefulPersistenceContext - initializing non-lazy collections
02-Jul-2018 15:51:52,788 DEBUG - AbstractSaveEventListener - executing identity-insert immediately
02-Jul-2018 15:51:52,788 DEBUG - AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
02-Jul-2018 15:51:52,788 DEBUG - SQL - insert into tbl_edoc_content (Content) values (?)
02-Jul-2018 15:51:52,788 DEBUG - IdentifierGeneratorHelper - Natively generated identity: 29
02-Jul-2018 15:51:52,788 DEBUG - AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
02-Jul-2018 15:51:52,788 DEBUG - AbstractSaveEventListener - executing identity-insert immediately
02-Jul-2018 15:51:52,788 DEBUG - AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
02-Jul-2018 15:51:52,788 DEBUG - SQL - insert into tbl_edoc_section (DocumentID, Type, Depth, SectionNumber, Title, NextID, PreviousID, ContentID, Tag, unnumbered, indentDepth, BulletStyle, classification, userNumbered) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
02-Jul-2018 15:51:52,788 DEBUG - IdentifierGeneratorHelper - Natively generated identity: 26
02-Jul-2018 15:51:52,788 DEBUG - AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
02-Jul-2018 15:51:52,803 DEBUG - AbstractFlushingEventListener - processing flush-time cascades
02-Jul-2018 15:51:52,803 DEBUG - AbstractFlushingEventListener - dirty checking collections
02-Jul-2018 15:51:52,803 DEBUG - AbstractFlushingEventListener - Flushed: 0 insertions, 1 updates, 0 deletions to 20 objects
02-Jul-2018 15:51:52,803 DEBUG - AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
02-Jul-2018 15:51:52,803 DEBUG - Printer - listing entities:

This is a subset of the log for Hibernate 5:

02-Jul-2018 18:31:20,021 DEBUG - SQL - select content0_.ID as ID1_92_, content0_.Content as Content2_92_ from tbl_edoc_content content0_ where content0_.ID=1
02-Jul-2018 18:31:20,021 DEBUG - Loader - Result set row: 0
02-Jul-2018 18:31:20,021 DEBUG - Loader - Result row: EntityKey[uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 18:31:20,021 DEBUG - TwoPhaseLoad - Resolving associations for [uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 18:31:20,021 DEBUG - TwoPhaseLoad - Done materializing entity [uk.co.stasys.edoc.sectioning.Content#1]
02-Jul-2018 18:31:20,021 DEBUG - ActionQueue - Executing identity-insert immediately
02-Jul-2018 18:31:20,021 DEBUG - SQL - insert into tbl_edoc_content (Content) values (?)
02-Jul-2018 18:31:20,037 DEBUG - IdentifierGeneratorHelper - Natively generated identity: 29
02-Jul-2018 18:31:20,037 DEBUG - ResourceRegistryStandardImpl - HHH000387: ResultSet’s statement was not registered
02-Jul-2018 18:31:20,037 DEBUG - ActionQueue - Executing identity-insert immediately
02-Jul-2018 18:31:20,037 DEBUG - SQL - insert into tbl_edoc_section (DocumentID, Type, Depth, SectionNumber, Title, NextID, PreviousID, ContentID, Tag, unnumbered, indentDepth, BulletStyle, classification, userNumbered) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
02-Jul-2018 18:31:20,053 DEBUG - IdentifierGeneratorHelper - Natively generated identity: 26
02-Jul-2018 18:31:20,053 DEBUG - ResourceRegistryStandardImpl - HHH000387: ResultSet’s statement was not registered
02-Jul-2018 18:31:20,053 DEBUG - CriteriaQueryImpl - Rendered criteria query -> select generatedAlias0 from Note as generatedAlias0 where ( generatedAlias0.documentId=3 ) and ( generatedAlias0.sectionId=1 ) order by generatedAlias0.position asc
02-Jul-2018 18:31:20,053 DEBUG - QueryTranslatorImpl - parse() - HQL: select generatedAlias0 from uk.co.stasys.edoc.comm.notes.Note as generatedAlias0 where ( generatedAlias0.documentId=3 ) and ( generatedAlias0.sectionId=1 ) order by generatedAlias0.position asc
02-Jul-2018 18:31:20,053 DEBUG - ErrorCounter - throwQueryException() : no errors
02-Jul-2018 18:31:20,053 DEBUG - QueryTranslatorImpl - — HQL AST —
-[QUERY] Node: ‘query’
±[SELECT_FROM] Node: ‘SELECT_FROM’
| ±[FROM] Node: ‘from’
| | -[RANGE] Node: ‘RANGE’
| | ±[DOT] Node: ‘.’
| | | ±[DOT] Node: ‘.’
| | | | ±[DOT] Node: ‘.’
| | | | | ±[DOT] Node: ‘.’
| | | | | | ±[DOT] Node: ‘.’
| | | | | | | ±[DOT] Node: ‘.’
| | | | | | | | ±[IDENT] Node: ‘uk’
| | | | | | | | -[IDENT] Node: ‘co’
| | | | | | | -[IDENT] Node: ‘stasys’
| | | | | | -[IDENT] Node: ‘edoc’
| | | | | -[IDENT] Node: ‘comm’
| | | | -[IDENT] Node: ‘notes’
| | | -[IDENT] Node: ‘Note’
| | -[ALIAS] Node: ‘generatedAlias0’
| -[SELECT] Node: ‘select’
| -[IDENT] Node: ‘generatedAlias0’
±[WHERE] Node: ‘where’
| -[AND] Node: ‘and’
| ±[EQ] Node: ‘=’
| | ±[DOT] Node: ‘.’
| | | ±[IDENT] Node: ‘generatedAlias0’
| | | -[IDENT] Node: ‘documentId’
| | -[NUM_INT] Node: ‘3’
| -[EQ] Node: ‘=’
| ±[DOT] Node: ‘.’
| | ±[IDENT] Node: ‘generatedAlias0’
| | -[IDENT] Node: ‘sectionId’
| -[NUM_INT] Node: ‘1’
-[ORDER] Node: ‘order’
±[DOT] Node: ‘.’
| ±[IDENT] Node: ‘generatedAlias0’
| -[IDENT] Node: ‘position’
-[ASCENDING] Node: ‘asc’

02-Jul-2018 18:31:20,053 DEBUG - HqlSqlBaseWalker - select << begin [level=1, statement=select]
02-Jul-2018 18:31:20,053 DEBUG - FromElement - FromClause{level=1} : uk.co.stasys.edoc.comm.notes.Note (generatedAlias0) -> note0_
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0 -> note0_.NoteId
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0 -> note0_.NoteId
02-Jul-2018 18:31:20,053 DEBUG - DotNode - getDataType() : documentId -> org.hibernate.type.IntegerType@27cf3151
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0.documentId -> note0_.DocumentId
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0 -> note0_.NoteId
02-Jul-2018 18:31:20,053 DEBUG - DotNode - getDataType() : sectionId -> org.hibernate.type.IntegerType@27cf3151
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0.sectionId -> note0_.SectionId
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0 -> note0_.NoteId
02-Jul-2018 18:31:20,053 DEBUG - DotNode - getDataType() : position -> org.hibernate.type.IntegerType@27cf3151
02-Jul-2018 18:31:20,053 DEBUG - FromReferenceNode - Resolved : generatedAlias0.position -> note0_.Pos
02-Jul-2018 18:31:20,053 DEBUG - HqlSqlBaseWalker - select : finishing up [level=1, statement=select]
02-Jul-2018 18:31:20,053 DEBUG - HqlSqlWalker - processQuery() : ( SELECT ( {select clause} note0_.NoteId ) ( FromClause{level=1} tbl_edoc_notes note0_ ) ( where ( and ( = ( note0_.DocumentId note0_.NoteId documentId ) 3 ) ( = ( note0_.SectionId note0_.NoteId sectionId ) 1 ) ) ) ( order ( note0_.Pos note0_.NoteId position ) asc ) )
02-Jul-2018 18:31:20,053 DEBUG - JoinProcessor - Using FROM fragment [tbl_edoc_notes note0_]
02-Jul-2018 18:31:20,053 DEBUG - HqlSqlBaseWalker - select >> end [level=1, statement=select]
02-Jul-2018 18:31:20,053 DEBUG - QueryTranslatorImpl - — SQL AST —
-[SELECT] QueryNode: ‘SELECT’ querySpaces (tbl_edoc_notes)
±[SELECT_CLAUSE] SelectClause: ‘{select clause}’
| ±[ALIAS_REF] IdentNode: ‘note0_.NoteId as NoteId1_110_’ {alias=generatedAlias0, className=uk.co.stasys.edoc.comm.notes.Note, tableAlias=note0_}
| -[SQL_TOKEN] SqlFragment: ‘note0_.Version as Version2_110_, note0_.DocumentId as Document3_110_, note0_.SectionId as SectionI4_110_, note0_.Pos as Pos5_110_, note0_.Deleted as Deleted6_110_, note0_.Content as Content7_110_’
±[FROM] FromClause: ‘from’ FromClause{level=1, fromElementCounter=1, fromElements=1, fromElementByClassAlias=[generatedAlias0], fromElementByTableAlias=[note0_], fromElementsByPath=[], collectionJoinFromElementsByPath=[], impliedElements=[]}
| -[FROM_FRAGMENT] FromElement: ‘tbl_edoc_notes note0_’ FromElement{explicit,not a collection join,not a fetch join,fetch non-lazy properties,classAlias=generatedAlias0,role=null,tableName=tbl_edoc_notes,tableAlias=note0_,origin=null,columns={,className=uk.co.stasys.edoc.comm.notes.Note}}
±[WHERE] SqlNode: ‘where’
| -[AND] SqlNode: ‘and’
| ±[EQ] BinaryLogicOperatorNode: ‘=’
| | ±[DOT] DotNode: ‘note0_.DocumentId’ {propertyName=documentId,dereferenceType=PRIMITIVE,getPropertyPath=documentId,path=generatedAlias0.documentId,tableAlias=note0_,className=uk.co.stasys.edoc.comm.notes.Note,classAlias=generatedAlias0}
| | | ±[ALIAS_REF] IdentNode: ‘note0_.NoteId’ {alias=generatedAlias0, className=uk.co.stasys.edoc.comm.notes.Note, tableAlias=note0_}
| | | -[IDENT] IdentNode: ‘documentId’ {originalText=documentId}
| | -[NUM_INT] LiteralNode: ‘3’
| -[EQ] BinaryLogicOperatorNode: ‘=’
| ±[DOT] DotNode: ‘note0_.SectionId’ {propertyName=sectionId,dereferenceType=PRIMITIVE,getPropertyPath=sectionId,path=generatedAlias0.sectionId,tableAlias=note0_,className=uk.co.stasys.edoc.comm.notes.Note,classAlias=generatedAlias0}
| | ±[ALIAS_REF] IdentNode: ‘note0_.NoteId’ {alias=generatedAlias0, className=uk.co.stasys.edoc.comm.notes.Note, tableAlias=note0_}
| | -[IDENT] IdentNode: ‘sectionId’ {originalText=sectionId}
| -[NUM_INT] LiteralNode: ‘1’
-[ORDER] OrderByClause: ‘order’
±[DOT] DotNode: ‘note0_.Pos’ {propertyName=position,dereferenceType=PRIMITIVE,getPropertyPath=position,path=generatedAlias0.position,tableAlias=note0_,className=uk.co.stasys.edoc.comm.notes.Note,classAlias=generatedAlias0}
| ±[ALIAS_REF] IdentNode: ‘note0_.NoteId’ {alias=generatedAlias0, className=uk.co.stasys.edoc.comm.notes.Note, tableAlias=note0_}
| -[IDENT] IdentNode: ‘position’ {originalText=position}
-[ASCENDING] SqlNode: ‘asc’

02-Jul-2018 18:31:20,053 DEBUG - ErrorCounter - throwQueryException() : no errors
02-Jul-2018 18:31:20,053 DEBUG - QueryTranslatorImpl - HQL: select generatedAlias0 from uk.co.stasys.edoc.comm.notes.Note as generatedAlias0 where ( generatedAlias0.documentId=3 ) and ( generatedAlias0.sectionId=1 ) order by generatedAlias0.position asc
02-Jul-2018 18:31:20,053 DEBUG - QueryTranslatorImpl - SQL: select note0_.NoteId as NoteId1_110_, note0_.Version as Version2_110_, note0_.DocumentId as Document3_110_, note0_.SectionId as SectionI4_110_, note0_.Pos as Pos5_110_, note0_.Deleted as Deleted6_110_, note0_.Content as Content7_110_ from tbl_edoc_notes note0_ where note0_.DocumentId=3 and note0_.SectionId=1 order by note0_.Pos asc
02-Jul-2018 18:31:20,053 DEBUG - ErrorCounter - throwQueryException() : no errors
02-Jul-2018 18:31:20,053 DEBUG - AbstractFlushingEventListener - Processing flush-time cascades
02-Jul-2018 18:31:20,053 DEBUG - AbstractFlushingEventListener - Dirty checking collections
02-Jul-2018 18:31:20,053 DEBUG - AbstractFlushingEventListener - Flushed: 0 insertions, 3 updates, 0 deletions to 20 objects
02-Jul-2018 18:31:20,053 DEBUG - AbstractFlushingEventListener - Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
02-Jul-2018 18:31:20,053 DEBUG - EntityPrinter - Listing entities:


#2

Since there is no error being generated, you need to enable SQL logging and compare the two versions and post here the differences between 3.x and 5.x.


#3

@Vlad Here is the SQL log for 3:

06-Jul-2018 14:11:03,118 DEBUG - SQL - select this_.ID as ID33_0_, this_.Content as Content33_0_ from tbl_edoc_content this_ where this_.ID=?
06-Jul-2018 14:11:03,133 DEBUG - SQL - insert into tbl_edoc_content (Content) values (?)
06-Jul-2018 14:11:03,149 DEBUG - SQL - insert into tbl_edoc_section (DocumentID, Type, Depth, SectionNumber, Title, NextID, PreviousID, ContentID, Tag, unnumbered, indentDepth, BulletStyle, classification, userNumbered) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
06-Jul-2018 14:11:03,149 DEBUG - SQL - select this_.NoteId as NoteId50_0_, this_.Version as Version50_0_, this_.DocumentId as DocumentId50_0_, this_.SectionId as SectionId50_0_, this_.Pos as Pos50_0_, this_.Deleted as Deleted50_0_, this_.Content as Content50_0_ from tbl_edoc_notes this_ where this_.DocumentId=? and this_.SectionId=? order by this_.Pos asc
06-Jul-2018 14:11:03,149 DEBUG - SQL - select rationales0_.ID as ID52_, rationales0_.version as version52_, rationales0_.NodeID as NodeID52_, rationales0_.DocumentID as DocumentID52_, rationales0_.Pos as Pos52_, rationales0_.Title as Title52_, rationales0_.Description as Descript7_52_, rationales0_.RaisedIssue as RaisedIs8_52_, rationales0_.Eass as Eass52_, rationales0_.IoImpact as IoImpact52_, rationales0_.Ref as Ref52_, rationales0_.PlatReq as PlatReq52_, rationales0_.SysChange as SysChange52_, rationales0_.SopReq as SopReq52_, rationales0_.Sswr as Sswr52_, rationales0_.Status as Status52_, rationales0_.ChangeReq as ChangeReq52_, rationales0_.AddComment as AddComment52_, rationales0_.Reason as Reason52_, rationales0_.Date as Date52_, rationales0_.UserName as UserName52_, rationales0_.GlobalRationaleId as GlobalR22_52_, rationales0_.globalFlag as globalFlag52_, rationales0_.projectFlag as project24_52_, rationales0_.systemFlag as systemFlag52_, rationales0_.standardsFlag as standar26_52_, rationales0_.projectId as projectId52_, rationales0_.systemId as systemId52_ from tbl_edoc_rationales rationales0_ where rationales0_.DocumentID=? and rationales0_.NodeID=?
06-Jul-2018 14:11:03,180 DEBUG - SQL - select this_.ID as ID33_0_, this_.Content as Content33_0_ from tbl_edoc_content this_ where this_.ID=?
06-Jul-2018 14:11:03,180 DEBUG - SQL - select this_.ID as ID36_0_, this_.SectionID as SectionID36_0_, this_.DocumentID as DocumentID36_0_, this_.Type as Type36_0_, this_.SectionNumber as SectionN5_36_0_, this_.Title as Title36_0_, this_.Depth as Depth36_0_, this_.NextID as NextID36_0_, this_.PreviousID as PreviousID36_0_, this_.ContentID as ContentID36_0_, this_.Operation as Operation36_0_, this_.Tag as Tag36_0_, this_.unnumbered as unnumbered36_0_, this_.inserted as inserted36_0_, this_.BulletStyle as BulletS15_36_0_, this_.indentDepth as indentD16_36_0_, this_.classification as classif17_36_0_, this_.userNumbered as userNum18_36_0_ from tbl_edoc_deviatedSection this_ where this_.ID=?

And here is the log for 5:

06-Jul-2018 13:35:13,772 DEBUG - SQL - select content0_.ID as ID1_92_, content0_.Content as Content2_92_ from tbl_edoc_content content0_ where content0_.ID=1
06-Jul-2018 13:35:13,772 DEBUG - SQL - insert into tbl_edoc_content (Content) values (?)
06-Jul-2018 13:35:13,788 DEBUG - SQL - insert into tbl_edoc_section (DocumentID, Type, Depth, SectionNumber, Title, NextID, PreviousID, ContentID, Tag, unnumbered, indentDepth, BulletStyle, classification, userNumbered) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
06-Jul-2018 13:35:13,803 DEBUG - SQL - select note0_.NoteId as NoteId1_110_, note0_.Version as Version2_110_, note0_.DocumentId as Document3_110_, note0_.SectionId as SectionI4_110_, note0_.Pos as Pos5_110_, note0_.Deleted as Deleted6_110_, note0_.Content as Content7_110_ from tbl_edoc_notes note0_ where note0_.DocumentId=3 and note0_.SectionId=1 order by note0_.Pos asc
06-Jul-2018 13:35:13,803 DEBUG - SQL - select rationales0_.ID as ID1_111_, rationales0_.version as version2_111_, rationales0_.NodeID as NodeID3_111_, rationales0_.DocumentID as Document4_111_, rationales0_.Pos as Pos5_111_, rationales0_.Title as Title6_111_, rationales0_.Description as Descript7_111_, rationales0_.RaisedIssue as RaisedIs8_111_, rationales0_.Eass as Eass9_111_, rationales0_.IoImpact as IoImpac10_111_, rationales0_.Ref as Ref11_111_, rationales0_.PlatReq as PlatReq12_111_, rationales0_.SysChange as SysChan13_111_, rationales0_.SopReq as SopReq14_111_, rationales0_.Sswr as Sswr15_111_, rationales0_.Status as Status16_111_, rationales0_.ChangeReq as ChangeR17_111_, rationales0_.AddComment as AddComm18_111_, rationales0_.Reason as Reason19_111_, rationales0_.Date as Date20_111_, rationales0_.UserName as UserNam21_111_, rationales0_.GlobalRationaleId as GlobalR22_111_, rationales0_.globalFlag as globalF23_111_, rationales0_.projectFlag as project24_111_, rationales0_.systemFlag as systemF25_111_, rationales0_.standardsFlag as standar26_111_, rationales0_.projectId as project27_111_, rationales0_.systemId as systemI28_111_ from tbl_edoc_rationales rationales0_ where rationales0_.DocumentID=? and rationales0_.NodeID=?
06-Jul-2018 13:35:13,819 DEBUG - SQL - update tbl_edoc_section set DocumentID=?, Type=?, Depth=?, SectionNumber=?, Title=?, NextID=?, PreviousID=?, ContentID=?, Tag=?, unnumbered=?, indentDepth=?, BulletStyle=?, classification=?, userNumbered=? where ID=?
06-Jul-2018 13:35:13,819 DEBUG - SQL - update tbl_edoc_content set Content=? where ID=?
06-Jul-2018 13:35:13,819 DEBUG - SQL - update tbl_edoc_content set Content=? where ID=?
06-Jul-2018 13:35:13,819 DEBUG - SQL - select content0_.ID as ID1_92_, content0_.Content as Content2_92_ from tbl_edoc_content content0_ where content0_.ID=81
06-Jul-2018 13:35:13,819 DEBUG - SQL - select deviatedse0_.ID as ID1_95_, deviatedse0_.SectionID as SectionI2_95_, deviatedse0_.DocumentID as Document3_95_, deviatedse0_.Type as Type4_95_, deviatedse0_.SectionNumber as SectionN5_95_, deviatedse0_.Title as Title6_95_, deviatedse0_.Depth as Depth7_95_, deviatedse0_.NextID as NextID8_95_, deviatedse0_.PreviousID as Previous9_95_, deviatedse0_.ContentID as Content10_95_, deviatedse0_.Operation as Operati11_95_, deviatedse0_.Tag as Tag12_95_, deviatedse0_.unnumbered as unnumbe13_95_, deviatedse0_.inserted as inserte14_95_, deviatedse0_.BulletStyle as BulletS15_95_, deviatedse0_.indentDepth as indentD16_95_, deviatedse0_.classification as classif17_95_, deviatedse0_.userNumbered as userNum18_95_ from tbl_edoc_deviatedSection deviatedse0_ where deviatedse0_.ID=1
06-Jul-2018 13:35:13,834 DEBUG - SQL - update tbl_edoc_content set Content=? where ID=?
06-Jul-2018 13:35:13,834 DEBUG - SQL - update tbl_edoc_content set Content=? where ID=?

There are five additional commands in 5 compared to 3, all updates, which are not operations initiated by us.


#4

Try to see where the updates come from. Without seeing the code, I have no clue what might cause it.


#5

The code is not instigating the updates nor is it amending either of the objects after the initial insert between the load of the data from tbl_edoc_rationale and the select from tbl_edoc_content.


#6

Maybe you are using unidirectional OneToMany associations, which might cause some redundant updates.

Check out this article for more details about what SQL statements each OneToMany association generates and why you should prefer bidirectional OneToMany or just the ManyToOne side.


#7

We are not using any associations in any of these objects.


#8

Try to replicate it and send a Pull Request so we can debug it.


#9

Hi Vlad, I have been unable to replicate the hibernate ORM, but have created a small project in github that reproduces the issue - https://github.com/rowenaG/HibernateTest. The issue shows up on each select of the Content record on line 101 - each time more and more updates are made to the Content table. I suspect the issue may be something to do with the way I am creating a CLOB in the Content class.


#10

Your project is very similar to a Hibernate test case, so it’s better to send it via a Pull Request since it gets a higher priority that way.