java - hibernate.jdbc.batch_size set to 50 not allowing to test single update during exception -
i needed fix security vulnerability stating exception contains sensitive details whenever application unable update data in db , have fixed catching db exception , customizing error message.
to test fix, need execute updatelist service , validate response in hibernate hibernate.jdbc.batch_size set 50 due single update cannot tested return data updated because update query hit database when update count reaches 50.
i can test fix if putting sessionfactory.getcurrentsession().flush() mentioned below.
public void update(final list list) { sessionfactory.getcurrentsession().update(list); sessionfactory.getcurrentsession().flush(); }
is there other best solution? or flush() force query or queries updated in db not sure impact on hibernate.jdbc.batch_size = 50;
"update query hit database when update count reaches 50" not true. hit db when transaction closed.
you can add flush
, may lead performance degradation (hibernate.jdbc.batch_size=50
there reason).
i suggest put try catch in other place. if servlet add custom filter. save such exception in different place. hibernate
hard predict when decide flush data db.
Comments
Post a Comment