mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
set a timeout on more queries
This commit is contained in:
@@ -152,6 +152,12 @@ public abstract class GenericDAO<T extends AbstractModel> {
|
||||
query.unwrap(Query.class).setCacheable(true);
|
||||
return query;
|
||||
}
|
||||
|
||||
protected void setTimeout(javax.persistence.Query query, int queryTimeout) {
|
||||
if (queryTimeout > 0) {
|
||||
query.setHint("javax.persistence.query.timeout", queryTimeout);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected Class<T> getType() {
|
||||
|
||||
Reference in New Issue
Block a user