Re: Transaction issue?

Vadim Nasardinov <[email protected]>
Newsgroups gmane.linux.redhat.ccm.general
Organization Red Hat / Westford
Message-ID <[email protected]>
On Tuesday 23 March 2004 09:48, Dhanya Unnikrishnan wrote:
> I am trying to insert data into a table, and update another table, one
> after the other. I do it this way:
>
> 1) Begin the transaction.
> 2) Insert into table A
> 3) Commit the transaction.
> 4) Update table B
>
> Update table B doesn't happen.

Because you put the update outside the transaction.  Move it inside.

> read that BaseServlet handles all the transactions. Do I have to use the
> BaseServlet? I have a servlet for my application. How do I make use of
> BaseServlet along with my servlet?

If you want to use BaseServlet, you will want to subclass it.  Examples of
how this is done can be found in

$ find core/src/ cms/src/ -name \*.java | \
  xargs grep BaseServlet | grep extends | cut -d : -f 1
core/src/com/arsdigita/versioning/VersioningServlet.java
core/src/com/arsdigita/web/BaseApplicationServlet.java
core/src/com/arsdigita/web/BaseJSP.java
core/src/com/arsdigita/web/BaseServlet.java
core/src/com/arsdigita/web/DispatcherServlet.java
core/src/com/arsdigita/web/LegacyInitializerServlet.java
core/src/com/arsdigita/web/OIDRedirectServlet.java
core/src/com/arsdigita/web/ResourceServlet.java
cms/src/com/arsdigita/cms/dispatcher/ContentTypeXSLServlet.java
cms/src/com/arsdigita/cms/dispatcher/ContentItemXSLServlet.java


If you don't want to subclass BaseServlet, then your second best bet is to
copy and paste some of the transaction-handling code from BaseServlet
into your own servlet.



-- 
Redhat-ccm-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/redhat-ccm-list
Archives: https://www.redhat.com/pipermail/redhat-ccm-list/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.