cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent L Johnson" <>
Subject Multiple DB Inserts for XSP?
Date Fri, 23 Jan 2004 20:32:48 GMT
I'm using the authentication framework to handle logins
on the site I'm working on.  When the login is handled successfully the
pipeline should do a map:generate for an XSP that does a database insert
into a login_log table.

But - when I login.. I get TWO rows into the database,
for one single insert.  I'm not sure how this is happening.. sometimes
the timestamp between the inserts is 2-3 seconds.

Its only me logging in.. no one else.. this is just really driving me
crazy.  Here's is the auth snippet from my sitemap:

    <map:match pattern="performLogin.html">
        <map:act type="auth-loggedIn">
            <map:parameter name="handler" value="authhandler"/>
            <map:redirect-to uri="main.html"/>
        <map:act type="auth-login">
            <map:parameter name="handler" value="authhandler"/>
            <map:parameter name="parameter_userid"
            <map:parameter name="parameter_password"

            <map:generate type="serverpages" src="loginComplete.xsp"/>
            <map:transform src="styles/welcome.xsl" type="xslt"/>
            <map:transform src="styles/main.xsl"/>
            <map:serialize type="html"/>
        <!-- authentication failed: -->
        <map:generate src="login.xml"/>
        <map:transform src="styles/main.xsl">
            <map:parameter name="failure" value="true"/>
        <map:serialize type="html"/>

And here is the exact esql code I'm using in loginComplete.xsp (where
the insert is being done):

                insert into login_log (login, timestamp, host, results)
values (<esql:parameter><xsp-request:get-parameter
name="userid"/></esql:parameter>, NOW(),

I've searched.. there is no other code that inserts data into this
table.  And that file only appears ONCE in the whole sitemap.xmap file.
Right there in performLogin.html.

I cleared out my database table, tried a single login.. and here are the
| id | login | timestamp           | results | host          |
| 17 | vha   | 2004-01-23 15:01:18 | SUCCESS | |
| 18 | vha   | 2004-01-23 15:01:21 | SUCCESS | |

Does anyone have any idea why it's doing this?  I'm sure it some small
stupid mistake on my part.. but I'm have a hard time trying to pin down
why this code would be executing twice.

And notice that 3 second gap in the timestamp.  That seems strange. I've
seen it as large as 5 seconds.. sometimes its the same.

Any help would be greatly appreciated.


- Brent

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message