{"id":61,"date":"2008-11-23T15:43:51","date_gmt":"2008-11-23T20:43:51","guid":{"rendered":"http:\/\/www.jetpen.com\/blog\/?p=61"},"modified":"2023-02-04T23:16:45","modified_gmt":"2023-02-05T05:16:45","slug":"java-christmas-wishlist-2008","status":"publish","type":"post","link":"https:\/\/www.jetpen.com\/blog\/2008\/11\/23\/java-christmas-wishlist-2008\/","title":{"rendered":"java christmas wish list 2008"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>JPA preCommit<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Similar to the other events (PrePersist, PreRemove, PostPersist, PostRemove, PreUpdate, PostUpdate, and PostLoad), JPA needs to add a preCommit event. This would be useful for enforcing constraints (invariants) using Java logic, similar to how less expressive deferred constraints can be enforced in SQL.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>read-only transaction<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">javax.transaction.UserTransaction needs the ability to begin a transaction with an awareness of whether the transaction will be read-only or read-write. A read-only transaction would prevent writes (inserts, updates, and deletes) from being done.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>dynamic immutability<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It would be helpful if an instance of an object can be mutable, when used by some classes (e.g., builder, factory, repository, deserializer), and immutable, when used by others. This would facilitate the ability to load persistent objects from a data store, derive transient fields from persistent fields, and marking the instance as immutable if the transaction is read-only. I do not want to develop entities that have both a mutable class and an immutable class; and access control (private, protected) is not sufficient, if the mutability is dependent on context (e.g., read-only transaction).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JPA preCommit Similar to the other events (PrePersist, PreRemove, PostPersist, PostRemove, PreUpdate, PostUpdate, and PostLoad), JPA needs to add a preCommit event. This would be useful for enforcing constraints (invariants) using Java logic, similar to how less expressive deferred constraints can be enforced in SQL. read-only transaction javax.transaction.UserTransaction needs the ability to begin a transaction &hellip; <a href=\"https:\/\/www.jetpen.com\/blog\/2008\/11\/23\/java-christmas-wishlist-2008\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">java christmas wish list 2008<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":2147,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[3],"tags":[14],"class_list":["post-61","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-platform"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.jetpen.com\/blog\/wp-content\/uploads\/2008\/11\/WPQ05utglX9emZcEFSwD.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8eKak-Z","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":1,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"predecessor-version":[{"id":2483,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/posts\/61\/revisions\/2483"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/media\/2147"}],"wp:attachment":[{"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jetpen.com\/blog\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}