会话在向数据库保存数据期间过期

huangapple go评论56阅读模式
英文:

Session expire during data saving to database

问题

我正在尝试上传一个 Excel 文件并将其数据保存到数据库中。这个 Excel 文件包含 4690 行数据,在数据插入数据库时会话已过期。在我的 web.xml 文件中,我已经添加了以下内容。

<session-config>
<session-timeout>15</session-timeout>
</session-config>

我需要延长这个特定页面的会话时间。

英文:

I am trying to upload an excel file and save its data to database. The excel contain 4690 rows of data, the session is expired during data is inserting to the data base. In my web.xml file i had added these lines.

&lt;session-config&gt;
&lt;session-timeout&gt;15&lt;/session-timeout&gt;
&lt;/session-config&gt;

I need to extend session of this particular page.

答案1

得分: 1

你可以在你的Java代码中设置会话超时时间,以覆盖默认超时时间:

request.getSession().setMaxInactiveInterval(timeoutInSeconds);

这对你是否可行?请告诉我!
会话在向数据库保存数据期间过期

英文:

You can set the session timeout in your javacode to override the default timeout:

request.getSession().setMaxInactiveInterval(timeoutInSeconds);

Can that be a workable solution for you? Please let me know!

会话在向数据库保存数据期间过期

huangapple
  • 本文由 发表于 2020年8月22日 18:35:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/63535166.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定