Results 1 to 1 of 1
- 06-19-2019, 04:15 PM #1
Member
- Join Date
- Nov 2015
- Posts
- 10
- Rep Power
- 0
Configure hibernate to use "show-sql=false" temprarily
Hi there,
I have a java progam using Maven, JPA, Eclipse, Jenkins. While developing I have the setting
spring:
jpa:
show-sql: true
in my application.yml file which works fine. Now, for a load test I have huge chunk of data. If I execute the test it works fine in Eclipse, but fails in Maven as the SureFire Plugin fails on such large console output. I can make it work by redirecting the console to a file, but that won't work for Jenkins and it won't work if I start the tests altogether because I want to see the result on the console obviously. So I would like to have this setting (show-sql) be switched off temporarily. I suppose it must live somewhere in the JPA / Hibernate configuration classes, but I couldn't find any combination yet that would allow me to change it.
The closest I suppose I came to it was by this:
entityManager.setProperty( "hibernate.show_sql", false );
entityManager.setProperty( "spring.jpa.hibernate.show_sql", false );
entityManager.setProperty( "javax.persistence.hibernate.show_sql", false );
Where the entityManager is autowired to the component. But when reading those properties, the return is some values from a completely different namespace (some timeout values), so I reckon I am in the wrong corner...
Any advise is appreciated,
Stephan
Similar Threads
-
How to avoid lazy="false" in hibernate
By stsivaraj in forum HibernateReplies: 1Last Post: 07-10-2014, 12:47 PM -
Help : i want a String with either "true" or "false" in it?
By 00sonthuy00 in forum New To JavaReplies: 4Last Post: 11-02-2013, 01:53 PM -
access denied("java.net.SocketPermission" "127.0.0.1:1099" "connect,resolve")
By klspepper in forum New To JavaReplies: 0Last Post: 12-07-2012, 09:29 AM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 08:35 AM -
How to configure "keep alive" in Sockets?
By rajdotme in forum NetworkingReplies: 1Last Post: 04-17-2008, 12:36 AM
Bookmarks