On Tue, 22 Mar 2016 16:55:46 -0300, g kuczera <gkucz...@gmail.com> wrote:
Hi guys,
Hi!
binder.bind(UserDao.class, UserDaoImpl.class).scope(ScopeConstants.PERTHREAD);
Why is it perthread-scoped? I've never seen a DAO which actually needed that.
List<Object> birthDatesList = userDao.getSession().createSQLQuery("select birthdate from user where id = " + userId).list();
I'm sorry, but this line of code is awful and a risk for SQL injections. You could have written Date date = (Date) session.createCriteria(User.class).setProjection(Projections.property("birthdate")).uniqueResult();
Also, getting the Session from the DAO and using Hibernate directly is completely against of what a DAO is, but I get that this is just test code. ;)
I also logged the birth dates of the other users, and the problem occurs only in the 28/03/1982 case. Have you ever noticed anything like that?
I have not. Maybe some DST-related issue? -- Thiago H. de Paula Figueiredo Tapestry, Java and Hibernate consultant and developer http://machina.com.br --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org