{"id":121634,"date":"2024-04-18T11:44:52","date_gmt":"2024-04-18T08:44:52","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=121634"},"modified":"2024-04-18T11:44:54","modified_gmt":"2024-04-18T08:44:54","slug":"spring-boot-transaction-aware-caching-example","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html","title":{"rendered":"Spring Boot Transaction-Aware Caching Example"},"content":{"rendered":"<p><strong>Caching<\/strong> stands as a crucial technique in application development, enhancing performance and alleviating strain on databases and other resources. Within the Spring Framework, leveraging transaction-aware caching safeguards data consistency while maximizing caching benefits. Let&#8217;s delve into understanding the nuances of Spring&#8217;s transaction-aware caching.<\/p>\n<h2><a name=\"understanding-transaction-aware-caching\"><\/a>1. Understanding Transaction-Aware Caching<\/h2>\n<p><a href=\"https:\/\/docs.spring.io\/spring-framework\/docs\/current\/javadoc-api\/org\/springframework\/cache\/transaction\/TransactionAwareCacheManagerProxy.html\" target=\"_blank\" rel=\"noopener\">Transaction-aware caching<\/a> is a sophisticated technique employed in software development to enhance performance and maintain data consistency within applications. In the context of the Spring Framework, transaction-aware caching plays a pivotal role in optimizing database operations while ensuring the integrity of data transactions.<\/p>\n<h3>1.1 How Does Transaction-Aware Caching Work?<\/h3>\n<p>In traditional caching mechanisms, data retrieved from databases or other resources is stored temporarily in memory to expedite subsequent requests for the same data. However, in transaction-aware caching, caching operations are synchronized with database transactions. Here&#8217;s how it typically works:<\/p>\n<ul>\n<li>Cache Population: When data is fetched from the database within a transaction, it is simultaneously stored in the cache.<\/li>\n<li>Cache Invalidation: If the transaction is successful, the cached data remains valid. However, if the transaction fails or is rolled back, the cached data is invalidated to maintain data consistency.<\/li>\n<\/ul>\n<h3>1.2 Benefits of Transaction-Aware Caching<\/h3>\n<p>Utilizing transaction-aware caching in Spring applications offers several advantages:<\/p>\n<ul>\n<li>Improved Performance: By reducing the need to repeatedly access the database, transaction-aware caching significantly improves application response times.<\/li>\n<li>Data Consistency: Transactions and caching are synchronized, ensuring that cached data accurately reflects the current state of the database.<\/li>\n<li>Reduced Database Load: With frequently accessed data stored in memory, transaction-aware caching alleviates strain on database resources, leading to better scalability and resource utilization.<\/li>\n<\/ul>\n<h2><a name=\"setting-up-transaction-awarecaching-in-springboot\"><\/a>2. Setting Up Transaction-Aware Caching in Spring Boot<\/h2>\n<p>Transaction-aware caching is a powerful technique for enhancing application performance while maintaining data consistency. Let&#8217;s start by setting up our Spring Boot application:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>2.1 Configure Cache Provider<\/h3>\n<p>The first step is to specify the cache provider in your Spring Boot application. Spring Boot supports various caching providers such as Ehcache, Redis, and Hazelcast. You can configure the desired cache provider in the <code>application.properties<\/code> file:<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">\nspring.cache.type=ehcache\n<\/pre>\n<p>In this example, we&#8217;re using Ehcache as the caching provider.<\/p>\n<h3>2.2 Enable Caching Support<\/h3>\n<p>Next, enable caching support in your Spring Boot application. You can do this by annotating your main application class with <code>@EnableCaching<\/code>:<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">\nimport org.springframework.boot.SpringApplication;\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\nimport org.springframework.cache.annotation.EnableCaching;\n\n@SpringBootApplication\n@EnableCaching\npublic class MyApplication {\n\n    public static void main(String[] args) {\n        SpringApplication.run(MyApplication.class, args);\n    }\n}\n<\/pre>\n<p>This annotation enables Spring&#8217;s caching support in your application.<\/p>\n<h3>2.3 Define Caching Configuration<\/h3>\n<p>Define caching configuration by creating a bean that specifies caching behavior. You can customize caching settings such as cache names, expiration policies, and eviction strategies.<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">\nimport org.springframework.cache.annotation.EnableCaching;\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.cache.ehcache.EhCacheManagerFactoryBean;\n\n@Configuration\n@EnableCaching\npublic class CacheConfig {\n\n    @Bean\n    public EhCacheManagerFactoryBean ehCacheManagerFactory() {\n        EhCacheManagerFactoryBean cacheManagerFactory = new EhCacheManagerFactoryBean();\n        cacheManagerFactory.setConfigLocation(new ClassPathResource(\"ehcache.xml\"));\n        cacheManagerFactory.setShared(true);\n        return cacheManagerFactory;\n    }\n}\n<\/pre>\n<p>In this example, we&#8217;re specifying the location of the Ehcache configuration file (<code>ehcache.xml<\/code>). You can customize this file according to your caching requirements.<\/p>\n<h3>2.4 Implement Transaction-Aware Caching<\/h3>\n<p>To make your caching transaction-aware, annotate your service methods with <code>@Transactional<\/code> and <code>@Cacheable<\/code> annotations. The <code>@Transactional<\/code> annotation ensures that caching and database transactions are synchronized.<\/p>\n<pre class=\"brush:java; wrap-lines:false;\">\nimport org.springframework.cache.annotation.Cacheable;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\n@Service\npublic class DataService {\n\n    @Cacheable(value = \"dataCache\", key = \"#id\")\n    @Transactional\n    public Data fetchDataById(Long id) {\n        \/\/ Method logic to fetch data from the database\n    }\n}\n<\/pre>\n<p>In this example, the <code>@Cacheable<\/code> annotation caches the result of the <code>fetchDataById<\/code> method based on the provided cache name (&#8220;dataCache&#8221;) and method parameter (&#8220;id&#8221;). The <code>@Transactional<\/code> annotation ensures that the caching operation is synchronized with the database transaction.<\/p>\n<h2><a name=\"conclusion\"><\/a>3. Run the Spring boot application<\/h2>\n<p>Run the following command:<\/p>\n<pre class=\"brush:plain; wrap-lines:false;\">\nmvn spring-boot:run\n<\/pre>\n<p>The application initiates on the default port, which is set to <code>8080<\/code>. Modifying the server port is achievable by adjusting the port number in the <code>application.properties<\/code> file.<\/p>\n<h2><a name=\"conclusion\"><\/a>4. Conclusion<\/h2>\n<p>Transaction-aware caching is a crucial optimization technique for enhancing the performance and data consistency of Spring Boot applications. By synchronizing caching operations with database transactions, transaction-aware caching ensures that cached data remains accurate and up-to-date.<\/p>\n<p>Implementing transaction-aware caching involves configuring the cache provider, enabling caching support, defining caching configuration, and annotating service methods with appropriate annotations. Through these steps, developers can leverage the benefits of caching while maintaining the integrity of critical data operations.<\/p>\n<p>By adopting transaction-aware caching, developers can achieve significant improvements in application response times, reduce database load, and enhance scalability. This technique is particularly valuable in scenarios where performance optimization and data consistency are paramount concerns.<\/p>\n<p>In conclusion, transaction-aware caching is a powerful tool that enables Spring Boot applications to achieve optimal performance while ensuring data integrity, ultimately contributing to a better user experience and more efficient resource utilization.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Caching stands as a crucial technique in application development, enhancing performance and alleviating strain on databases and other resources. Within the Spring Framework, leveraging transaction-aware caching safeguards data consistency while maximizing caching benefits. Let&#8217;s delve into understanding the nuances of Spring&#8217;s transaction-aware caching. 1. Understanding Transaction-Aware Caching Transaction-aware caching is a sophisticated technique employed in &hellip;<\/p>\n","protected":false},"author":26931,"featured_media":240,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[30,854,346],"class_list":["post-121634","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-spring","tag-spring-boot","tag-terracotta-ehcache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Boot Transaction-Aware Caching Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Spring Transaction-aware Caching: Optimize Spring apps to boost performance &amp; ensure data consistency seamlessly.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot Transaction-Aware Caching Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Spring Transaction-aware Caching: Optimize Spring apps to boost performance &amp; ensure data consistency seamlessly.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2024-04-18T08:44:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-18T08:44:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Yatin Batra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Yatin Batra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html\"},\"author\":{\"name\":\"Yatin Batra\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\"},\"headline\":\"Spring Boot Transaction-Aware Caching Example\",\"datePublished\":\"2024-04-18T08:44:52+00:00\",\"dateModified\":\"2024-04-18T08:44:54+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html\"},\"wordCount\":667,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"keywords\":[\"Spring\",\"Spring Boot\",\"Terracotta Ehcache\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html\",\"name\":\"Spring Boot Transaction-Aware Caching Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"datePublished\":\"2024-04-18T08:44:52+00:00\",\"dateModified\":\"2024-04-18T08:44:54+00:00\",\"description\":\"Spring Transaction-aware Caching: Optimize Spring apps to boost performance & ensure data consistency seamlessly.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/spring-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"spring-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/spring-boot-transaction-aware-caching-example.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Spring Boot Transaction-Aware Caching Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cda31a4c1965373fed40c8907dc09b8d\",\"name\":\"Yatin Batra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/12\\\/Yatin.batra_.jpg\",\"caption\":\"Yatin Batra\"},\"description\":\"An experience full-stack engineer well versed with Core Java, Spring\\\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).\",\"sameAs\":[\"https:\\\/\\\/www.javacodegeeks.com\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/yatin-batra\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Boot Transaction-Aware Caching Example - Java Code Geeks","description":"Spring Transaction-aware Caching: Optimize Spring apps to boost performance & ensure data consistency seamlessly.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html","og_locale":"en_US","og_type":"article","og_title":"Spring Boot Transaction-Aware Caching Example - Java Code Geeks","og_description":"Spring Transaction-aware Caching: Optimize Spring apps to boost performance & ensure data consistency seamlessly.","og_url":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2024-04-18T08:44:52+00:00","article_modified_time":"2024-04-18T08:44:54+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","type":"image\/jpeg"}],"author":"Yatin Batra","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Yatin Batra","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html"},"author":{"name":"Yatin Batra","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d"},"headline":"Spring Boot Transaction-Aware Caching Example","datePublished":"2024-04-18T08:44:52+00:00","dateModified":"2024-04-18T08:44:54+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html"},"wordCount":667,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","keywords":["Spring","Spring Boot","Terracotta Ehcache"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html","url":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html","name":"Spring Boot Transaction-Aware Caching Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","datePublished":"2024-04-18T08:44:52+00:00","dateModified":"2024-04-18T08:44:54+00:00","description":"Spring Transaction-aware Caching: Optimize Spring apps to boost performance & ensure data consistency seamlessly.","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/spring-logo.jpg","width":150,"height":150,"caption":"spring-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/spring-boot-transaction-aware-caching-example.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Spring Boot Transaction-Aware Caching Example"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cda31a4c1965373fed40c8907dc09b8d","name":"Yatin Batra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/12\/Yatin.batra_.jpg","caption":"Yatin Batra"},"description":"An experience full-stack engineer well versed with Core Java, Spring\/Springboot, MVC, Security, AOP, Frontend (Angular &amp; React), and cloud technologies (such as AWS, GCP, Jenkins, Docker, K8).","sameAs":["https:\/\/www.javacodegeeks.com"],"url":"https:\/\/www.javacodegeeks.com\/author\/yatin-batra"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/121634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/26931"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=121634"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/121634\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/240"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=121634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=121634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=121634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}