{"id":25720160,"url":"https://github.com/gregwhitaker/caffeine-writethrough-example","last_synced_at":"2025-05-06T19:45:45.646Z","repository":{"id":82732487,"uuid":"119319448","full_name":"gregwhitaker/caffeine-writethrough-example","owner":"gregwhitaker","description":"Example of implementing a write-through cache with Caffeine","archived":false,"fork":false,"pushed_at":"2018-01-29T03:45:08.000Z","size":65,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T02:21:32.918Z","etag":null,"topics":["caching","caffeine","database-caching","write-through"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gregwhitaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-29T02:12:34.000Z","updated_at":"2024-03-17T00:43:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"6923ee21-fb0a-4baa-82c3-df3b6b835033","html_url":"https://github.com/gregwhitaker/caffeine-writethrough-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcaffeine-writethrough-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcaffeine-writethrough-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcaffeine-writethrough-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gregwhitaker%2Fcaffeine-writethrough-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gregwhitaker","download_url":"https://codeload.github.com/gregwhitaker/caffeine-writethrough-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252756765,"owners_count":21799548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caching","caffeine","database-caching","write-through"],"created_at":"2025-02-25T17:36:43.121Z","updated_at":"2025-05-06T19:45:45.631Z","avatar_url":"https://github.com/gregwhitaker.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# caffeine-writethrough-example\n[![Build Status](https://travis-ci.org/gregwhitaker/caffeine-writethrough-example.svg?branch=master)](https://travis-ci.org/gregwhitaker/caffeine-writethrough-example)\n\nAn example of implementing a write-through cache with [Caffeine](https://github.com/ben-manes/caffeine).\n\n## Prerequisites\nThis example requires a running PostgreSQL database. Start a PostgreSQL instance as a Docker container using the following commands:\n\n        $ docker pull postgres\n        $ docker run --name=proteus-db -p 5432:5432 -d postgres\n\n## Running the Example\nThe example can be run using the following Gradle command:\n\n    $ ./gradlew clean run\n    \nIf successful, you will see the following in the terminal:\n\n    [main] INFO caffeine.caching.example.Main - Starting the Caffeine Write-Through Cache Example\n    [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...\n    [main] INFO com.zaxxer.hikari.pool.PoolBase - HikariPool-1 - Driver does not support get/set network timeout for connections. (Method org.postgresql.jdbc.PgConnection.getNetworkTimeout() is not yet implemented.)\n    [main] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Start completed.\n    [main] INFO caffeine.caching.example.Main - Creating database connection: jdbc:postgresql://localhost:5432/postgres\n    [main] INFO caffeine.caching.example.Main - Adding 1: This is the number 1\n    [main] INFO caffeine.caching.example.Main$DatabaseCacheWriter - Adding cache value to database: [key: 1, value: This is the number 1]\n    [main] INFO caffeine.caching.example.Main - Adding 2: This is the number 2\n    [main] INFO caffeine.caching.example.Main$DatabaseCacheWriter - Adding cache value to database: [key: 2, value: This is the number 2]\n    [main] INFO caffeine.caching.example.Main - Adding 3: This is the number 3\n    [main] INFO caffeine.caching.example.Main$DatabaseCacheWriter - Adding cache value to database: [key: 3, value: This is the number 3]\n    [main] INFO caffeine.caching.example.Main - Getting `1` From Cache: This is the number 1\n    [main] INFO caffeine.caching.example.Main - Getting `2` From Cache: This is the number 2\n    [main] INFO caffeine.caching.example.Main - Getting `3` From Cache: This is the number 3\n    [main] INFO caffeine.caching.example.Main - Loading value from database: [key: 4]\n    [main] INFO caffeine.caching.example.Main - Getting `4` From Cache: This is the number 4\n\n## Bugs and Feedback\nFor bugs, questions, and discussions please use the [Github Issues](https://github.com/gregwhitaker/caffeine-writethrough-example/issues).\n\n## License\nMIT License\n\nCopyright (c) 2018 Greg Whitaker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fcaffeine-writethrough-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgregwhitaker%2Fcaffeine-writethrough-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgregwhitaker%2Fcaffeine-writethrough-example/lists"}