You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brent L Johnson <br...@bjohnson.net> on 2004/03/05 21:38:46 UTC

Multiple DB Inserts (revisited)

The original thread for this is:
http://marc.theaimsgroup.com/?t=107488892100004&r=1&w=2

In a nutshell.. I'm using the authentication framework
(now with Cocoon 2.1.4) and I'm still having this multiple
insert problem.

Here is the sitemap snippet...

    <map:match pattern="performLogin.html">
        <map:act type="auth-loggedIn">
            <map:parameter name="handler" value="authhandler"/>
            <map:redirect-to uri="main.html"/>
        </map:act>
        <map:act type="auth-login">
            <map:parameter name="handler" value="authhandler"/>
            <map:parameter name="parameter_userid"
value="{request-param:userid}"/>
            <map:parameter name="parameter_password"
value="{request-param: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"/>
        </map:act>
        <!-- authentication failed: -->
        <map:generate src="login.xml"/>
        <map:transform src="styles/main.xsl">
            <map:parameter name="failure" value="true"/>
        </map:transform>
        <map:serialize type="html"/>
    </map:match>

It appears as though loginComplete.xsp is being executed twice.

I thought about switching it to use
modular database actions.. but it seems by using those
the data that gets inserted is mapped directly to
request parameters correct?

Well how would I handle things like "now()" in mysql
(the insert is a login log.. everytime someone attempts
to login I'm logging it.. but I get two logs entries
for each login attempt).  Or what about constant
type values?  (like a SUCCESS or FAILURE flag)

Any help would be appreciated.. the site I'm working
on is set to be open to production use by customers
next month (its been in testing by the customer but
no one has noticed the multiple logins in the log yet..
hehe).

Thanks,

- Brent


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Internal Cocoon Problem? - Multiple DB Inserts (revisited)

Posted by Brent L Johnson <br...@bjohnson.net>.
In case it helps.. I cleared out the logs and
logged in.. then noticed these error level messages
in error.log and access.log.. dont know if this
could be the cause of the multiple inserts from
my XSP... (the exceptions are the same in both files)

ERROR   (2004-03-05) 15:33.39:606   [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Cocoon got an Exception while trying to
close stream.
java.io.IOException: The stream has been closed
    at
org.apache.catalina.connector.ResponseStream.flush(ResponseStream.java:2
38)
    at
org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1197)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:247)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:193)
...

ERROR   (2004-03-05) 15:34.34:091   [access] (/performLogin.html)
HttpProcessor[80][4]/CocoonServlet: Internal Cocoon Problem
ClientAbortException:  java.net.SocketException: Broken pipe
    at
org.apache.catalina.connector.ResponseBase.flushBuffer(ResponseBase.java
:680)
    at
org.apache.catalina.connector.HttpResponseBase.doFlushBuffer(HttpRespons
eBase.java:795)
    at
org.apache.catalina.connector.HttpResponseBase.flushBuffer(HttpResponseB
ase.java:785)
    at
org.apache.catalina.connector.ResponseBase.write(ResponseBase.java:648)
...

ERROR   (2004-03-05) 15:34.34:111   [access] (Unknown-URI)
Unknown-thread/CocoonServlet: Cocoon got an Exception while trying to
close stream.
ClientAbortException:  java.net.SocketException: Broken pipe
    at
org.apache.catalina.connector.ResponseBase.flushBuffer(ResponseBase.java
:680)
    at
org.apache.catalina.connector.HttpResponseBase.doFlushBuffer(HttpRespons
eBase.java:795)
    at
org.apache.catalina.connector.HttpResponseBase.flushBuffer(HttpResponseB
ase.java:785)
    at
org.apache.catalina.connector.ResponseFacade.flushBuffer(ResponseFacade.
java:228)
...


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org