# Running Liquibase from @Singleton EJB

**URL:** <https://forum.liquibase.org/t/running-liquibase-from-singleton-ejb/733>\
**Category:** General Discussion\
**Created:** [August 17, 2010, 2:36pm UTC](https://forum.liquibase.org/t/running-liquibase-from-singleton-ejb/733 "2010-08-17T14:36:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anahata](https://avatars.discourse-cdn.com/v4/letter/a/bc8723/32.png) [@anahata](https://forum.liquibase.org/u/anahata)\
**Post date:** [August 17, 2010, 2:36pm UTC](https://forum.liquibase.org/t/running-liquibase-from-singleton-ejb/733/1 "2010-08-17T14:36:00Z")

</div>

Hi,

We are building an EJB + app client JEE6 application.

I am new to liquibase and I see there is a ServletListener and a Spring implementation for the kick-off.

For us, as we don’t have a web module or use spring either, would be very convenient to be able to deploy it as a @Singleton EJB 3.1.

If there is a programmatic way of calling liquibase, we could also do it from the @PostConstruct of the singleton EJB.

In summary:

Does it sounds like a good idea to add a singleton ejb implementation to the liquibase binaries so we could add it to ejb-jar.xml (ejb3.1) for those people who do not use web modules?

Is there a programmatic way of running Liquibase from @PostConstruct of @Singleton EJB?

Pablo.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [August 17, 2010, 2:36pm UTC](https://forum.liquibase.org/t/running-liquibase-from-singleton-ejb/733/2 "2010-08-17T14:36:00Z")

</div>

Yes, if you take a look at the source for the SpringLiquibase class or ServletListener you can see how to call liquibase programatically.&nbsp; It mainly consists of creating an instance of liquibase.Liquibase then calling the update() method

Nathan
