3 Replies Latest reply on Aug 21, 2008 7:45 AM by marklittle

    JBoss Transactions in stand-alone app (no AS)

    bbb321

      Hello

      First of all I'm new to JTA.

      I have a stand-alone application, no JBoss AS, not database. I just use a distributed JBoss POJO cache and JBoss JTA.
      The architecture consists of a server machine and some gui clients. The clients have access to only some cache nodes (they just don't know the Fqn of others).
      I've managed to manipulate the cache content in distributed transactions, which worked ok.

      My problem

      Because the clients don't have enough knowledge about all the data, they can't verify the integrity of the model when they commit some modifications.
      I see that on a Transaction obtained from the TransactionManager I can registerSynchronization() and put some validation code there. The validation can be done only on my server machine. If I start a transaction from the client machine, can I control it before it commits?

      In other workds how do I ensure consistency in my user transactions?

        • 1. Re: JBoss Transactions in stand-alone app (no AS)
          marklittle

          What do you mean by "consistency"?

          Have you read any of the transaction literature?

          • 2. Re: JBoss Transactions in stand-alone app (no AS)
            bbb321

            By consistency I mean domain model integrity after I make a commit.

            Example: From my client machine I can access/see only one pojo cached from an entire collection and I want to set some property on it.
            That property must be unique for all the pojo's in the entire collection, so some checks should be made before I commit. I can't do that check from my client machine because I can't access all the necesary data.

            So the checks must be done in another place. How could I do that and still allow transactions from my client machine without involving it in the checking process (because as I said it hasn't all the necessary data).

            • 3. Re: JBoss Transactions in stand-alone app (no AS)
              marklittle

              Seems like you need to write a Resource Manager that knows how to move your state from one consistent state to another. If the service (backend) is the place where the data resides, then that's the place where the consistency check should be done.