[Play1 1.4.0] Java 8 support

364 views
Skip to first unread message

Scott Rippee

unread,
Nov 13, 2015, 6:02:10 PM11/13/15
to play-framework
Does Play 1.4.0 run on java 8?

Thanks

Scott Rippee

unread,
Nov 16, 2015, 6:16:26 PM11/16/15
to play-framework
I've been experimenting with running on java 8 and I haven't encountered any problems.  I've heard that the version of Hibernate (4.2.19) is the part of the framework that can encounter problems if it's using the data in an ORM class, which I am not.  So perhaps some will run fine and others may have problems.
Message has been deleted

hans

unread,
Nov 19, 2015, 9:50:39 AM11/19/15
to play-framework
Scott,

Hi, we are currently in maintenance and development of two projects, both were developed from scratch, one is 5 years old, and the other 3.
They are in the order of 90.000 lines of java.

To date we have migrated just one of them, the other keeps freezin randomly on development.
Since the appearing of 1.3 we have been looking forward to move to java8 and its fantastic features, but hasn't been easy.

We have experienced some trouble moving to play 1.4 and java 8, but actually the migrated project is running smoothly in production and development.

One of our main concerns was performance of the database backed model, looking forward we found that one the hibernate parameters: max_fetch_depth, was being ignored, for us is the most important hibernate parameter, then we found that:

In 1.2.x we use:
hibernate.max_fetch_depth=1

In 1.4 it should be:
hibernate.default.max_fetch_depth=1

Our first aproaches before debugging JPAPlugin was to use a hibernate property file.

After that we still were experiencing some freezing in development mode, investigating with jvisualvm we found that c3p0 the pool manager of hibernate was the cause, so we added hibernate.properties file with:

hibernate.max_fetch_depth=1
hibernate.generate_statistics=false
hibernate.c3p0.minPoolSize=5
hibernate.c3p0.maxPoolSize=100
hibernate.c3p0.initialPoolSize=5
hibernate.c3p0.acquireIncrement=5
hibernate.c3p0.maxIdleTime=1800
hibernate.c3p0.maxStatementsPerConnection=500
hibernate.c3p0.numHelperThreads=5

It's actually working better after that.

bye,
Hans Poo

Scott Rippee

unread,
Nov 19, 2015, 8:14:21 PM11/19/15
to play-framework
Thanks, that's really helpful!

Setting the c3p0 settings in application.conf like:

db.default.pool.timeout=4000
db.default.pool.maxSize=80
db.default.pool.minSize=15

didn't work for you or you needed to set additional parameters that play doesn't set in DBPlugin, but get set when they're in the hibernate.properties? 

hans

unread,
Nov 20, 2015, 7:34:58 AM11/20/15
to play-framework
Scott,

It is a little long story,

In the first attemtp to set database related paramaters in application.conf, we didn't get the exact syntax, may be we skim too fast over documentation.
Putting log4j.properties and setting hibernate full debug verified our guess that the parameteres where not being used or setted by play the way we were using them.
Then we found that the file hibernate.properties were really doing the job.
After that we debug JPAPlugin to find the regex that it uses for parameters decoding, and found the way it should be in the framework.

Finally we are using a mix of both techinques.

Bye
Hans

Martin Russmann

unread,
Dec 10, 2015, 12:25:37 PM12/10/15
to play-framework
Hi, good idea, do you put the hibernate.properties file in the conf-directory of your application? Thanks Martin 

hans

unread,
Dec 11, 2015, 8:25:35 AM12/11/15
to play-framework
Martin,

Thanks to the standard usage of java classloading mechanism for loading property files, you can put it in any folder in tha classpath. For instance the app folder.

In stack overflow there is a related discussion:
http://stackoverflow.com/questions/70216/whats-the-purpose-of-meta-inf

Bye
Hans
Reply all
Reply to author
Forward
0 new messages