1

I intend to use play web framework with AciveJDBC for persistence. The issue with active JDBC is that it requires instrumentation. My question is ,

Will I need to do a restart on the server to see the changes made on classes that need instrumentation?

Chris Seymour
  • 83,387
  • 30
  • 160
  • 202
joshua
  • 4,118
  • 3
  • 40
  • 53

2 Answers2

3

joshua: this has never been attempted, but the answer would be no, you would have to restart the server to have changes in models to have an effect. However, if you practice true TDD and write tests that test models completely, you will not have to restart.

To Pere Villega: your answer is on the mark, and Hibernate truly is a popular framework, but it "being a great tool" is a matter of opinion and IMHO it is not, hence I developed ActiveJDBC.

A small fact: original version of ActiveJDBC back in 2009 did instrumentation on the fly in memory after an app start, which was great, but this has proven unreliable because of some containers' class loader behavior.

Additionally, I developed a Java web framework similar to Ruby on Rails: http://code.google.com/p/activeweb/, which has integration with ActiveJDBC. Currently it will recompile/reload controllers, but will not recompile/instrument models. However, I have plans to introduce this capability into the framework in the future.

cheers,

Igor

ipolevoy
  • 5,432
  • 2
  • 31
  • 46
1

as a disclaimer, I never tried what you said. But from my knowledge on how Play works, this will depend on your integration of ActiveJDBC with Play.

As far as I know, there is no existing module for that integration. This means you will need to create something to plug your model (ActiveJDBC - based) with the Play Model. Similar to what the Siena plugin does, for example.

Once done, with no extra changes Play will only recompile the Java class, using the Eclipse compiler, but it won't generate any instrumentation. For that instrumentation to happen you will probably need to tweak the recompile process so it also generates the instrumentation.

So, short answer, by default instrumentation won't work.

A somehow related question: do you really need ActiveJDBC? What does it offer that JPA/Hibernate (the default in Play) won't? I understand the appealing of an "Active Record" behavior, but even in the Ruby community there are some complains on its "magic". Are you sure JPA is not good enough? Using it would save you time and headaches when working with Play, and Hibernate a big team and lot of experience developing ORM, which makes it a great tool...

Pere Villega
  • 16,429
  • 5
  • 63
  • 100
  • Thanks for your detailed response. I was actually trying to stay away from hibernate(when it works it works. when it fails ...). Anyway i will believe that hibernate/jpa wont mess me up in future with unexpected behaviors. – joshua Mar 09 '11 at 13:45