I am trying to do some sync queries (node.mysql)
and render the result. Zappa 0.4, Express 3.0, CS

pr_art = [
  { .etc etc
  }
]
...
  @post '/process': (req, res) ->  #PROCESSPROCESS-POST QUERY f.SHOWSTOCK
    async.waterfall [(callback) ->
      MysqlConnection = mysql.createConnection(mysql_options)
      MysqlConnection.connect()
      MysqlConnection.query sql, (err, rowcount) ->
        ..do stuff....
        MysqlConnection.end
        callback null, rowcount
    , (rowcount, callback) ->
        MysqlConnection.connect()
        MysqlConnection.query sql, (err, pr_art) ->
          ...some more stuff...
        callback null, pr_art
    ], (err, pr_art) ->
        @render showstock2: {
          art: pr_art
          artname: pr_art[0].artname
            ....
          }

@view showstock2 .....

and I get "TypeError: Cannot call method 'render' of null
or 'of undefined'

If I do it with a '@redirect' to a '@get' that renders 'showstock2'
it works seemingly but I understand that is not good practice
and probably not safe under more load?

Where do I think wrong and what's best practice for this sort of
issue anyway?

Thanks in advance.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to