Title: Add @RequestScoped EntityManager Example · Issue #238 · javaee-samples/javaee7-samples · GitHub
Open Graph Title: Add @RequestScoped EntityManager Example · Issue #238 · javaee-samples/javaee7-samples
X Title: Add @RequestScoped EntityManager Example · Issue #238 · javaee-samples/javaee7-samples
Description: A very common pattern is to use an EntityManager which is @RequestScoped with CDI. This is often referred to as the entitymanager-per-request pattern. Currently I am unable to make this work in coordination with @Transactional without go...
Open Graph Description: A very common pattern is to use an EntityManager which is @RequestScoped with CDI. This is often referred to as the entitymanager-per-request pattern. Currently I am unable to make this work in coo...
X Description: A very common pattern is to use an EntityManager which is @RequestScoped with CDI. This is often referred to as the entitymanager-per-request pattern. Currently I am unable to make this work in coo...
Opengraph URL: https://github.com/javaee-samples/javaee7-samples/issues/238
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add @RequestScoped EntityManager Example","articleBody":"A very common pattern is to use an EntityManager which is `@RequestScoped` with CDI. This is often referred to as the _entitymanager-per-request pattern_.\n\nCurrently I am unable to make this work in coordination with `@Transactional` without going `SynchronizationType.UNSYNCHRONIZED` and manually calling an `entityManager.joinTransaction()`\n\n```\npublic class PersistenceResources {\n\n @PersistenceContext(type = PersistenceContextType.EXTENDED, synchronization = SynchronizationType.SYNCHRONIZED)\n private EntityManager em;\n\n @Produces\n @RequestScoped\n private EntityManager requestScopedEntityManager() {\n return em;\n }\n}\n```\n\nUnfortunately all the entities appear to get detached after the first transaction commits. Is this pattern possible with EE 7 without having to manually join to the transaction?\n","author":{"url":"https://github.com/codylerum","@type":"Person","name":"codylerum"},"datePublished":"2014-07-14T14:08:14Z","url":"https://github.com/javaee-samples/javaee7-samples/issues/238"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a464fb20-b29e-6686-4c4e-ba4b60244298 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7B0:B1B84:2B9EA84:3784681:6B01E907 |
| html-safe-nonce | 6b7872f663c60f9fe0458cb77aaded1d6b888c915152e639cbd4ba1b3377064e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0IwOkIxQjg0OjJCOUVBODQ6Mzc4NDY4MTo2QjAxRTkwNyIsInZpc2l0b3JfaWQiOiIzMDkxNTg4ODY1Mjg3MzgzMzAzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 82bff8a4a8a5e61e86e7a304b5e12b4cf8517d6a5e7e7c1dd84a8df1394dbc1f |
| hovercard-subject-tag | issue:37789347 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/javaee-samples/javaee7-samples/238/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0b7b8e37b368aefed700337f381662eda9c787a030f88f1217f5a355b8576cc6/javaee-samples/javaee7-samples/issues/238 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0b7b8e37b368aefed700337f381662eda9c787a030f88f1217f5a355b8576cc6/javaee-samples/javaee7-samples/issues/238 |
| og:image:alt | A very common pattern is to use an EntityManager which is @RequestScoped with CDI. This is often referred to as the entitymanager-per-request pattern. Currently I am unable to make this work in coo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | codylerum |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/javaee-samples/javaee7-samples git https://github.com/javaee-samples/javaee7-samples.git |
| octolytics-dimension-user_id | 6052086 |
| octolytics-dimension-user_login | javaee-samples |
| octolytics-dimension-repository_id | 12414592 |
| octolytics-dimension-repository_nwo | javaee-samples/javaee7-samples |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 12414592 |
| octolytics-dimension-repository_network_root_nwo | javaee-samples/javaee7-samples |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width