You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by marco <ma...@hotmail.com> on 2002/02/20 08:49:50 UTC

howto make use of default database add, delete, update action for mutilple table at a time

I have a user input form and which is used to add/update/delete records in
serveral tables. I found a sample that came with cocoon, but it is simple
example that only one table is handled at a time.

How can I make use the default DatabaseAddAction, DatabaseUpdateAction,
DatabaseDeleteAction to manipulate the data of mutiple tables at a time.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Pascal Davoust <da...@yahoo.com>.
Yes, updating multiple tables in the same transaction is very frequent.

Thanks for the info! I'm looking forward working with it, it seems a real
improvement.

			Pascal.

-----Original Message-----
From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
Sent: Saturday, February 23, 2002 3:23 PM
To: cocoon-users@xml.apache.org
Subject: Re: howto make use of default database add, delete, update
action for mutilple table at a time


On 22.Feb.2002 -- 11:13 PM, Pascal Davoust wrote:
> I read in a post a few days ago (or was it in the archive?) that there
were
> some serious limitations with these actions, and that some work is
currently
> done to overcome those (something is already available in the scratchpad
to
> have a look, I believe).

A word of warning: The way the actions are used (declaration of modes and
all classnames
will change very shortly. Actually, that work is already done but since I
haven't
found the (spare) time to check they still work as expected it's not in the
CVS,
yet. Hope to find some time over this weekend though.)

What is "better" with the new ones:
	*) all actions work on arbitrary number of tables
	*) all actions may work on arbitrary number of tuples
	*) configuration is done in one file, table-sets select
	   the tables to work on
        *) autoincrement columns work better (currently mysql, hsqldb,
	   informix, but it's very easy to support any other as well)
        *) values can be obtained from arbitrary sources, source can
	   be specified per table-set and column
	*) results can be written to arbitrary destinations
	*) in- / output helper modules can be used with other components
	   like matchers, selectors, actions
	   (currently, only one example exists)
	*) currently available modules:
	   request attributes (in/out), request parameters (in), request header
(in)
	   session attributes (in/out)
	   more to come...

What is "worse" with the new ones:
	*) descriptor file syntax has changed
	*) uses additional components -> more complex -> slower (?)
	*) changes are on the way

> Does anybody know if this *serious* limitation could be part of the new,
> future, top-notch database actions?

What limitation are you refering to? Updating multiple tables / rows? Yes,
that
should be possible.

	Chris.

--
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 22.Feb.2002 -- 11:13 PM, Pascal Davoust wrote:
> I read in a post a few days ago (or was it in the archive?) that there were
> some serious limitations with these actions, and that some work is currently
> done to overcome those (something is already available in the scratchpad to
> have a look, I believe).

A word of warning: The way the actions are used (declaration of modes and all classnames
will change very shortly. Actually, that work is already done but since I haven't
found the (spare) time to check they still work as expected it's not in the CVS,
yet. Hope to find some time over this weekend though.)

What is "better" with the new ones:
	*) all actions work on arbitrary number of tables
	*) all actions may work on arbitrary number of tuples
	*) configuration is done in one file, table-sets select
	   the tables to work on
        *) autoincrement columns work better (currently mysql, hsqldb,
	   informix, but it's very easy to support any other as well)
        *) values can be obtained from arbitrary sources, source can
	   be specified per table-set and column
	*) results can be written to arbitrary destinations
	*) in- / output helper modules can be used with other components
	   like matchers, selectors, actions
	   (currently, only one example exists)
	*) currently available modules:
	   request attributes (in/out), request parameters (in), request header (in)
	   session attributes (in/out)
	   more to come...

What is "worse" with the new ones:
	*) descriptor file syntax has changed
	*) uses additional components -> more complex -> slower (?)
	*) changes are on the way

> Does anybody know if this *serious* limitation could be part of the new,
> future, top-notch database actions?

What limitation are you refering to? Updating multiple tables / rows? Yes, that
should be possible.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 26.Feb.2002 -- 02:31 PM, marco wrote:
> I don't know exactly how to invoke action mutiple times with serveral
> descriptor files.
> 
> Would you please demonstrate it?

out of my head (check syntax!):

	<map:match ......>
	    <map:act name="db-upd">
	       <map:parameter name="descriptor" value="one.xml"/>
	    </map:act>
	    <map:act name="db-upd">
	       <map:parameter name="descriptor" value="two.xml"/>
	    </map:act>
	    <map:generate ..../>
	    <....>
        </map:match>

or have the same action available under two names:

	<map:actions>
	   <map:action name="upd1" class="org.apache....DatabaseUpdateAction">
	      <descriptor>one.xml</descriptor>
           </map:action>
	   <map:action name="upd2" class="org.apache....DatabaseUpdateAction">
	      <descriptor>two.xml</descriptor>
           </map:action>
        </map:actions>


	<map:match ......>
	    <map:act name="upd1"/>
	    <map:act name="upd2"/>
	    <map:generate ..../>
	    <....>
        </map:match>

HTH

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by marco <ma...@hotmail.com>.
I don't know exactly how to invoke action mutiple times with serveral
descriptor files.

Would you please demonstrate it?


----- Original Message -----
From: "Christian Haul" <ha...@dvs1.informatik.tu-darmstadt.de>
To: <co...@xml.apache.org>
Sent: Friday, February 22, 2002 4:54 PM
Subject: Re: howto make use of default database add, delete, update action
for mutilple table at a time


> On 21.Feb.2002 -- 05:15 PM, marco wrote:
> > Thanks a lot. I was able to insert records to more than one table at a
time,
> > but according to the documentaion of the actions "DatabaseUpdateAction"
and
> > "DatabaseDeleteAction" that they can handle only one table at a time.
Please
> > advise.
>
> Indeed, this is true (just had a look at the code). The only
> possibility I see is to invoke the action multiple times with
> different descriptor files. Unfortunately, this will start more than
> one transaction :-(
>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Pascal Davoust <da...@yahoo.com>.
Hi,

I read in a post a few days ago (or was it in the archive?) that there were
some serious limitations with these actions, and that some work is currently
done to overcome those (something is already available in the scratchpad to
have a look, I believe).

Does anybody know if this *serious* limitation could be part of the new,
future, top-notch database actions?

Thanks,

			Pascal.

-----Original Message-----
From: Christian Haul [mailto:haul@dvs1.informatik.tu-darmstadt.de]
Sent: Friday, February 22, 2002 9:54 AM
To: cocoon-users@xml.apache.org
Subject: Re: howto make use of default database add, delete, update
action for mutilple table at a time


On 21.Feb.2002 -- 05:15 PM, marco wrote:
> Thanks a lot. I was able to insert records to more than one table at a
time,
> but according to the documentaion of the actions "DatabaseUpdateAction"
and
> "DatabaseDeleteAction" that they can handle only one table at a time.
Please
> advise.

Indeed, this is true (just had a look at the code). The only
possibility I see is to invoke the action multiple times with
different descriptor files. Unfortunately, this will start more than
one transaction :-(

	Chris.

--
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 21.Feb.2002 -- 05:15 PM, marco wrote:
> Thanks a lot. I was able to insert records to more than one table at a time,
> but according to the documentaion of the actions "DatabaseUpdateAction" and
> "DatabaseDeleteAction" that they can handle only one table at a time. Please
> advise.

Indeed, this is true (just had a look at the code). The only
possibility I see is to invoke the action multiple times with
different descriptor files. Unfortunately, this will start more than
one transaction :-(

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by marco <ma...@hotmail.com>.
Thanks a lot. I was able to insert records to more than one table at a time,
but according to the documentaion of the actions "DatabaseUpdateAction" and
"DatabaseDeleteAction" that they can handle only one table at a time. Please
advise.

----- Original Message -----
From: "Christian Haul" <ha...@dvs1.informatik.tu-darmstadt.de>
To: <co...@xml.apache.org>
Sent: Thursday, February 21, 2002 2:30 AM
Subject: Re: howto make use of default database add, delete, update action
for mutilple table at a time


> On 20.Feb.2002 -- 03:49 PM, marco wrote:
> > I have a user input form and which is used to add/update/delete records
in
> > serveral tables. I found a sample that came with cocoon, but it is
simple
> > example that only one table is handled at a time.
> >
> > How can I make use the default DatabaseAddAction, DatabaseUpdateAction,
> > DatabaseDeleteAction to manipulate the data of mutiple tables at a time.
>
> Easy: just add another table to the descriptor file. The action will
> attempt to insert data in all tables listed. Of cause, if it's not
> feeded enough data it will rollback the complete transaction.
>
> You may not use autoincrement columns with the default database
> actions if you need the column's value lateron. You may use the manual
> mode for autoincrement columns but that could have concurrency issues
> depending on your database setup.
>
> In scratchpad you'll find actions that don't have these
> limitations. While the descriptor file syntax will not change (being
> different from descriptor file for main trunk db actions!), the
> actions (including their name and how to employ the helpers) will
> change shortly.
>
> Chris.
>
> --
> C h r i s t i a n       H a u l
> haul@informatik.tu-darmstadt.de
>     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: howto make use of default database add, delete, update action for mutilple table at a time

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 20.Feb.2002 -- 03:49 PM, marco wrote:
> I have a user input form and which is used to add/update/delete records in
> serveral tables. I found a sample that came with cocoon, but it is simple
> example that only one table is handled at a time.
> 
> How can I make use the default DatabaseAddAction, DatabaseUpdateAction,
> DatabaseDeleteAction to manipulate the data of mutiple tables at a time.

Easy: just add another table to the descriptor file. The action will
attempt to insert data in all tables listed. Of cause, if it's not
feeded enough data it will rollback the complete transaction.

You may not use autoincrement columns with the default database
actions if you need the column's value lateron. You may use the manual
mode for autoincrement columns but that could have concurrency issues
depending on your database setup.

In scratchpad you'll find actions that don't have these
limitations. While the descriptor file syntax will not change (being
different from descriptor file for main trunk db actions!), the
actions (including their name and how to employ the helpers) will
change shortly.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>