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 7843415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:32:38+00:00 2026-06-02T16:32:38+00:00

i am trying to integrate circumflex-orm into a play-2.0 scala app. It works so

  • 0

i am trying to integrate circumflex-orm into a play-2.0 scala app. It works so far as i can retrieve and save elements into db.
What does not work is the cache handling – transaction management.

For instance, retrieve a list of objects, change one, store it into db works fine.
But if i retrieve the same list again, my object did not change.
It did not change in the meaning of, it did change in the database, but the cache doesn’t know anything about it.

I did post a question at the circurmflex group and they said they do it with a servletfilter (this is the actual code for it: (circumflex-orm transaction integration – look at main lifecycle).
Something like this would be enough:

class CircumflexContextFilter extends ServletFilter {

  import ru.circumflex.core._

  def doFilter(req: ServletRequest, res: ServletResponse, chain: FilterChain) {
    Context.executeInNew { ctx =>
      chain.doFilter(req, res)
    }
  } 
}

But i have no idea how to integrate this into a play 2.0 application.

Thanks in Advance,
Sven

  • 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-06-02T16:32:39+00:00Added an answer on June 2, 2026 at 4:32 pm

    It turned out to be easier than i thought, a guy at the irc (thanks noelw) pinpointed me to these docs: scala action composition
    Reading through that the answer is as easy as possible:

    First, write your own action class like this:

    import play.api.mvc.Action
    import play.api.mvc.Request
    import play.api.mvc.Result
    import ru.circumflex.core.Context
    
    case class ScircumflexOrmActionWrapper[A](action: Action[A]) extends Action[A] {
    
      def apply(request: Request[A]): Result = {
        Context.executeInNew { ctx =>
          action(request)
        }
      }
    
      lazy val parser = action.parser
    }
    

    And then call your actions like this:

    def index = ScircumflexOrmActionWrapper { Action { 
      val taskDbObj = Task AS "taskDb"
      val tasks = SELECT(taskDbObj.*).FROM(taskDbObj).ORDER_BY(taskDbObj.createdAt DESC).list 
      Ok(html.task.index(tasks))
    }}
    

    Thats it. I also wrote i blop post for the integration of circumflex-orm into play, if anyone is interested: integrate circumflex-orm in play 2.0 – scala

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

Sidebar

Related Questions

I am trying to integrate the TestFlight iOS SDK into my Forge app. Can't
I'm trying to integrate a Facebook send button into my site using Facebook app.
I am trying to integrate OpenFeint 2.12.5 into my app. I already read this
I am trying to integrate the TestFlightSdk into an app I've made using MonoTouch
I'm trying to integrate Django's comment app into my site but with no success.
I am trying to integrate AdMob into my Android Application, and can get it
I am trying to integrate the function into a map where you can enter
I'm trying to integrate dropbox into my BB Playbook app using adobe air in
I'm trying to integrate rspec_api_documentation (https://github.com/zipmark/rspec_api_documentation) into my sinatra app. I'm running into the
I'm trying to integrate an accounting solution into a web app I am developing.

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.