0

this is my problem...

I came from JBoss5 where I could set the values of the hibernate properties (hibernate.show_sql, hibernate.format_sql, hibernate.use_sql_comments, ...) at a given persistence.xml, using JBoss Property Syntax and configuring those values as system properties...

For those who are wondering what is "JBoss Property Syntax" is a syntax very similar to ANT properties... Example:

value ="${propKey[:defaultValue]}" (defaultValue is a literal value and it is optional)

So, in my persistence.xml files, i have something like this:

<properties>
   ...
   <property name="hibernate.show_sql" value="${xxx.hibernate.show_sql:false}" />
</properties>

This way, if I want to turn on that property, I just need to define a system property xxx.hibernate.show_sql=true and start the Server...

This schema is not working in wildfly9...

After searching in SO (similar question) and checking the Wildfly standalone.xml, i prove that this functionality is still available at widfly9... However, for the persistence.xml, i can't define default values...

If i define the property value as: ${xxx.hibernate.show_sql} it works; otherwise, it doesn't.

So, How Can I define default values??

Thanks!

Community
  • 1
  • 1
Carlitos Way
  • 3,279
  • 20
  • 30

1 Answers1

0

The easiest option would be to use the org.hibernate.SQL log category instead. You can configure that dynamically while the server is running.

CLI example:

/subsystem=logging/logger=org.hibernate.SQL:add(level=DEBUG)

If you want to see it on the console you'll also need to make sure the console handler is set to allow debug messages.

/subsystem=logging/console-handler=CONSOLE:write-attribute(name=level, value=DEBUG)
James R. Perkins
  • 16,800
  • 44
  • 60