{"id":2470,"date":"2022-08-30T15:25:08","date_gmt":"2022-08-30T15:25:08","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/01\/17\/what-are-the-preferred-ways-to-persist-data-in-server-in-runtime-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:25:08","modified_gmt":"2022-08-30T15:25:08","slug":"what-are-the-preferred-ways-to-persist-data-in-server-in-runtime-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/what-are-the-preferred-ways-to-persist-data-in-server-in-runtime-collection-of-common-programming-errors\/","title":{"rendered":"what are the preferred ways to persist data in server in runtime-Collection of common programming errors"},"content":{"rendered":"<p>I have a web application which has the UI having its requests handles by Struts Action class.<\/p>\n<p>Lets say that the UI sends data for 30 variables at a single request. The action class process the request and stores the 30 variables in a java object.<\/p>\n<p>I need to persist the data beyond the request scope (even after the server sends response back to client for that request received, the data has to be persisted), because i have another servlet which relies on this persisted data (those 30 variables updated through UI).<\/p>\n<p>Ways to persistence:<\/p>\n<ol>\n<li>Store it in DB<\/li>\n<li>Use JPA<\/li>\n<li>Use static variables.<\/li>\n<li>Using MQ<\/li>\n<\/ol>\n<p>Which among the above would you prefer? I guess the third option doesn&#8217;t hold good.<\/p>\n<p><strong>Added Points to have a better clarity:<\/strong><\/p>\n<ul>\n<li>\n<p>The UI sends a request (holds around 30 String variable data) for every 1 minute. For every one min, the persisted data has to be modified.<\/p>\n<\/li>\n<li>\n<p>The another servlet which relies on this persisted data is no way<br \/>\nrelated to the request, hence i believe the session context will not be shared.<\/p>\n<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2014-01-17 07:09:36. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have a web application which has the UI having its requests handles by Struts Action class. Lets say that the UI sends data for 30 variables at a single request. The action class process the request and stores the 30 variables in a java object. I need to persist the data beyond the request [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2470","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2470"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2470\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2470"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}