You should also Inject the session.

@Inject
private Session session;

Is this method in a controller, or do you have a DAO layer?

-----Original Message-----
From: Pillar [mailto:[email protected]]
Sent: Wednesday, November 28, 2012 2:59 PM
To: [email protected]
Subject: @CommitAfter not committing my transaction

Unless I'm understanding it wrong, the @CommitAfter on my method isn't 
committing the transaction.

        @CommitAfter
        public void call() {
                Session s = HibernateUtils.getSessionFactory().openSession();
                s.beginTransaction();
                User u = new User();
                u.setUsername("Pillar");
                u.setEmail("[email protected]");
                u.setPassword("poof");
                s.save(u);
        }

Once execution exits this method and my page is rendered, I check my database 
and there is no entry for the above user.

I'm on Tapestry 5.3 and have all the dependencies for tapestry-hibernate.

What am I doing wrong?



--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/CommitAfter-not-committing-my-transaction-tp5718364.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Since 1982, Starpoint Solutions has been a trusted source of human capital and 
solutions. We are committed to our clients, employees, environment, community 
and social concerns.  We foster an inclusive culture based on trust, respect, 
honesty and solid performance. Learn more about Starpoint and our social 
responsibility at http://www.starpoint.com/social_responsibility

This email message from Starpoint Solutions LLC is for the sole use of  the 
intended recipient(s) and may contain confidential and privileged  information. 
 Any unauthorized review, use, disclosure or distribution is prohibited.  If 
you are not the intended recipient, please contact the sender by reply email 
and destroy all copies of the original message.  Opinions, conclusions and 
other information in this message that do not relate to the official business 
of Starpoint Solutions shall be understood as neither given nor endorsed by it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to