Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6129423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:44:28+00:00 2026-05-23T16:44:28+00:00

In play framework application.conf there are lines: %test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0 %test.jpa.ddl=create But I am using MongoDB

  • 0

In play framework application.conf there are lines:

%test.db.url=jdbc:h2:mem:play;MODE=MYSQL;LOCK_MODE=0
%test.jpa.ddl=create

But I am using MongoDB with Morphia. How do I change above settings for testing?
Note that I am not using play framework morphia module.

From technical point of view, each unit test would have its own in memory instance of
mongodb test database. How to make that happen?

Also when I use session object in test code both in functional and unit tests, I get compile error value session not found. How to access session in test code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T16:44:28+00:00Added an answer on May 23, 2026 at 4:44 pm

    There isn’t a way to modify those settings to create an “in memory instance of mongodb”. If you want each unit test to have a clean copy of the database, you’ll have to setup & teardown a new copy of your database in mongodb for each test.

    You can grab the session cookie directly in your functional tests using Scope.Session.current().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to use MSSQL server with Play Framework, In my application.conf db.url=jdbc:microsoft:sqlserver://localhost\SQL2008:1433;DatabaseName=testDB db.driver=com.microsoft.jdbc.sqlserver.SQLServerDriver
Is it possible to set Ehcache properties from the application.conf with Play framework? i.e.
I'm new to Play framework. I'm trying to configure MySQL database as a datasource
I wondering is there an equivalent of this feature from play framework http://www.playframework.org/documentation/2.0/JavaAsync Basicly
I have a Play Framework application that sends emails using SMTP server. Now I
I am using FlexJson within my play framework application but at the point I
looking into hosting sites (for a play framework application) i have noticed 2 options
I've been working on a Play framework social networking application, and I've come across
I'm playing with play framework 2.0. I've copied the 'computer-database' application, run it with
I am trying to create an initial-data.yml file for a Play! Framework application. Part

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.