Disable onCommit after first commit
At times OnCommittedResponseWrapper#onResponseCommitted() can be invoked multiple times. For example, when flush is performed multiple times. This means that the session can be written multiple times which is inefficient. Instead, we should only save on the first update. Fixes gh-57
This commit is contained in:
@@ -202,6 +202,7 @@ abstract class OnCommittedResponseWrapper extends HttpServletResponseWrapper {
|
||||
private void doOnResponseCommitted() {
|
||||
if(!disableOnCommitted) {
|
||||
onResponseCommitted();
|
||||
disableOnResponseCommitted();
|
||||
} else if(logger.isDebugEnabled()){
|
||||
logger.debug("Skip invoking on");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user