Note that there are some explanatory texts on larger screens.

plurals
  1. POCorrect way to implement standalone Grails batch processes?
    primarykey
    data
    text
    <p>I want to implement the following:</p> <ol> <li>Web application in Grails going to MongoDB database</li> <li>Long-running batch processes populating and updating that database in the background</li> </ol> <p>I would like for both of them to reuse the same Grails services and same GORM domain classes (using mongodb plugin for Grails).</p> <p>For the Web application everything should work fine, including the dynamic GORM finder methods.</p> <p>But I cannot figure out how to implement the batch processes.</p> <p>a. If I implement them as Grails service methods, their long-running nature will be a problem. Even wrapping them in some async executors will unnecessarily complicate everything, as I'd like them each to be a separate Java process so they can be monitored and stopped easily and separately.</p> <p>b. If I implement them as src/groovy scripts and try to launch from command line, I cannot inject the Grails services properly (ApplicationHolder method throws NPE) or get the GORM finder methods to work. The standalone GORM guides all have Hibernate in mind and overall it seems not the right route to pursue.</p> <p>c. I considered the 'batch-launcher' Grails plugin but it failed to install and seems a bit abandoned.</p> <p>d. I considered the 'run-script' Grails command to run the scripts from src/groovy and it seems it might actually work in development, but seems not the right thing to do in production.</p> <p>I cannot be the only person with such a problem - so how is it generally solved?</p> <p>How do people run standalone scripts sharing the code base and DB with their Grails applications?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload