Dorollback performing rollback in confluence plugin filter. How to solve the transaction occurrence?

Hello, I am going to add drm function.
When uploading a file, a servlet filter is registered in atlassian-plugin.xml to create a plugin.
When the servlet path in “doFilter” is “/plugins/drag-and-drop/upload.action”, it was confirmed that the file was created using a stream.
Using the code below, until chain.doFilter is executed, the following WARN occurs, and the icon of the upload file is not created.
Is there any way to prevent WARN from happening?
If WARN does not occur, can the icon of the uploaded file be created?

Corresponding filter code :

AttachmentResource resource = new InputStreamAttachmentResource(new FileInputStream(file), filename_org, mimeType, file.length(), "");
resource1 = new InputStreamAttachmentResource(new FileInputStream(file), filename_org, mimeType, file.length(), "");
Attachment attachment = page.getAttachmentNamed(filename_org);

this.fileUploadManager.storeResource(resource, page);

chain.doFilter((ServletRequest)attachmentRequestWrapper, httpResponse);
return;

The WARN is as follows.

[INFO] [talledLocalContainer] 2020-05-25 16:49:51,982 WARN [http-nio-1990-exec-8] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:
[INFO] [talledLocalContainer] ->[null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1304699462)

Any solution or reference material would be appreciated.

From my experience this error most likely means that you are accessing the database outside a transaction. Try to warp all commands which access the database in a transaction template.

Thank you. Let’s try it