Announcement Announcement Module
Collapse
No announcement yet.
singletons in app container Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • singletons in app container

    So we are using struts and jboss with spring.

    Our Action contains a PageBuilder, which contains a service, all wired in spring.

    the action generates a report. on run 1, the values in the report were fine. One subsequent runs, the values are double the previous value.

    This means that the values are persisting in the service between runs, and subsequent runs are adding new data to the old values.

    So in our configuration, the pagebuilder and service bean defs were augmented with singleton=false, but the problem is still there....

    Does the action need a singleton=false attribute?

  • #2
    Where is the state held that is causing your report problems?

    Comment


    • #3
      the state is held in the service.

      Comment


      • #4
        Have you thought about using a <aop:scoped-proxy/>? Basically every request requires a new service, this might be more appropriate.

        Have a read.
        http://www.springframework.org/docs/...factory-scopes

        Comment


        • #5
          karldmoore

          thanx for the reference, it seems like it would work. However we are using 1.2.6, and that only seems available in > 2.0.

          Any other suggestions? I still don't really understand how this is happening -- if i tell the service to not be a singleton, then it should not persist between requests, unless the Action struts creates for the click is itself reused. Ive been in the struts documentation but see any mention of this....

          [edit] -- never mind guys, am dumb, i missed a class that needed to be not-singletoned because I didnt read the struts delegatingactionproxy docs....
          Last edited by shrndegruv; Jan 17th, 2007, 01:22 PM.

          Comment


          • #6
            Have you sorted this then?

            Comment


            • #7
              yes this problem is solved...

              Comment


              • #8
                Originally posted by shrndegruv View Post
                ...

                Any other suggestions? I still don't really understand how this is happening -- if i tell the service to not be a singleton, then it should not persist between requests, unless the Action struts creates for the click is itself reused. Ive been in the struts documentation but see any mention of this....
                For what it's worth, it is true that Struts re-uses Actions between requests.

                Comment

                Working...
                X