@DatabaseCall
public List<User> findAll() {
SQLQuery q = new SQLQueryImpl(getConnection(), dialect);
//...
}
--
You received this message because you are subscribed to a topic in the Google Groups "Querydsl" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/querydsl/Et16lquE4qM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to querydsl+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Timo,
You need implement this in a way that possibilities the same Configuration be possible to close the connection or no. For example:void insertSomething(Something obj){obj.setId(nextval(qObj, connection)); //At this point the connection is kept open because it will be used in next operationsqlDelete.where(qObj.id.eq(obj.getId())).execute(); //At this point the connection is kept open because it will be used in next operationsqlInsert.populate(obj).executeAndClose(); //At this point the connection is closed because it's no longer necessary}Something findSomethingById(Long id){return query(qOj,conn).where(qObj.id.eq(id)).listAndClose(qObj); //At this point the connection is closed because it's no longer necessary}
Methods in SQLQuery and DML classes can be:SQLInsertClause.execute(Boolean isToCloseConnection)SQLQuery.list(Boolean isToCloseConnection)SQLQuery.closeConnectionAfterList();SQLQuery.setCloseConnectionAfterList(Boolean isToCloseConnection);
2014-02-05 timowest via Querydsl <querydsl+noreply-APn2wQefkk7kI02e0xPnNp6yrNOiXUEZ44_gIyQiFakJHtI@googlegroups.com>:
--
Atenciosamente,
Marlon Patrick
In truth I use QueryDSL in application that runs in JBOSS server and it offer a way of close connections automatically after exit of ejb context, but, generates a error message case detect that a programmer forgot closes connection.
The EJB itself has interceptors and I could use them to make this "automatic", but closure would be a very complex control. Add Spring to my project just for that, does not sound cool to me. Finally, note that suggestion and when possible put in QueryDSL especially considering applications that run outside a container as you yourself said.
Hi Timo,
Has a ticket for this?
To unsubscribe from this group and all its topics, send an email to querydsl+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
Atenciosamente,
Marlon Patrick
--
You received this message because you are subscribed to the Google Groups "Querydsl" group.
To unsubscribe from this group and stop receiving emails from it, send an email to querydsl+u...@googlegroups.com.