bookmarks  4

  •  

    Hibernate saveOrUpdate trap for web developers and StaleStateException Summary: Hibernate users should be aware of saveOrUpdate method if they continue to use the same persistent object even if a transaction failed at some point. Details: Suppose you have a persistent object bound to your web(like JSF) views. Entered some data (which will lead to a db ConstraintViolationException) and tried to save it (at your DAO service) by using saveOrUpdate method. As we expected, it will throw a ConstraintViolationException and you'll rollback the transaction. Then, go back to the entry page, correct the wrong field value at the same object, and try to save it again. You'll get a StaleStateException since saveOrUpdate method assigned identifier values automatically to your new object when you attempt to save it first. Later, when the save operation failed, it didn't roll back your object's state to its initial state. The summary of the flow causing this error is as below;
    16 years ago by @gresch
    (0)
     
     
  •  

    Any enterprise-class application that interacts with databases needs to take care of transactional integrity across database tables, databases, and components. Typically you achieve this either by using the heavy plumbing of application servers or by leveraging the Java Transaction API (JTA) at code level. Both approaches have their merits and demerits. In the case of application servers, someone has to pay for all the infrastructure services, but the server platform does provide an out-of-the-box solution for cross-cutting concerns like security, transaction, and persistence. Server infrastructures like those provided by BEA or IBM address the full process associated with architecture, prototype, design, development, packaging, deployment, and monitoring. If instead you go for direct JTA API integration at the application code level, you don't need to pay for the additional server infrastructure, but you may end up with business logic mixed with infrastructure-level code. It is in this context that you need to think of lightweight containers that will help you wire application logic components with infrastructure services like transaction handling without the necessity of having a full-blown application server. Spring is one such lightweight container that uses Aspect Oriented Programming (AOP) techniques for integrating cross-cutting services with components. This article walks you through a running example implemented using a mix of three powerful, complementary J2EE technology frameworks: Spring, Hibernate, and JOTM.
    16 years ago by @gresch
    (0)
     
     
  •  

    The purpose of this project is to provide an implementaion of OFX for Java. This project targets Java developers, so the primary means of getting started is diving right into the code. You could skim the user guide for an idea of how to use this library, but once you get started, you'll probably find the JavaDocs most useful.
    16 years ago by @gresch
    (0)
     
     
  •  

    In spite of the example working, transaction management is not working appropriately when it comes to both Hibernate and JBossCache participating of the same transaction. The reason is because at the time of writing this wiki, Hibernate did not allow to inject a JTA Transaction Manager which is not bound to JNDI. In the example, Hibernate creates a JDBC transaction and JBossCache a JTA transaction which are not linked together. To be able to make a Hibernate and JBossCache participant of the same JTA transaction in a standalone environment, customer code needs to be added to Hibernate to get around the JNDI/JTA coupling.
    16 years ago by @gresch
    (0)
     
     
  • ⟨⟨
  • 1
  • ⟩⟩

publications  

    No matching posts.
  • ⟨⟨
  • ⟩⟩