Search code examples
ibm-mobilefirst

MFP 7.1 - How to use Oracle database for development environment


How can I use Oracle database for development environment? The reason I want to do that because I want to reproduce the issue we found in Test environment with push notification, - (users gets unsubscribed atomically when restarts the app. User ID automatically gets overwritten by some code in PUSH_SUBSCRIPTION table.)

Derby which come with dev does not allow 2 connections.

Do I need to install the server or can I just point to existing oracle database where I already have WLADMIN and WRKLIGHT schema created.


Solution

  • Actually the development environment does support Oracle.

    Open the your-project\server\conf\worklight.properties.
    In this file there is the following section:

    ############################################
    #   DB Settings [Development Only]
    ############################################
    
    # For MySQL
    #wl.db.url=jdbc:mysql://localhost:3306/WRKLGHT
    # For Derby
    #wl.db.url=jdbc:derby:${worklight.home}/derby/WorklightDB;create=true
    #wl.reports.db.url=jdbc:derby:${worklight.home}/derby/WorklightReportsDB;create=true
    # For DB2
    #wl.db.url=jdbc:db2:WRKLGHT
    # For Oracle
    #wl.db.url=jdbc:oracle:thin:@localhost:1521:SID
    
    #wl.db.username=worklight
    #wl.db.password=worklight
    

    Uncomment the line for Oracle (wl.db.url) and the wl.db.username and wl.db.password lines.

    Fill in these lines with the correct details.

    The next start, before starting the server, is to ensure that the database is ready.

    If you already have an existing server, it could work. But if you want to test properly you should probably have a clean one. Either way, backup your database.

    Because you'll be testing this from Studio, I think that the database will be created automatically for you on server startup (unlike with external servers where you must do this on your own). You may need to create it anyway, though. You'll need to run the ant script to generate the various tables.