How to know there is a new transaction?
First: to get transactions from all accounts, use the "*" wildcard.

Second: Bitcoin version 0.5 includes a new listsinceblock RPC command that makes polling for new transactions more efficient.

I wrote a monitorreceived patch that does an HTTP POST whenever a new block or transaction-to-or-from-your-wallet was received, but I haven't pulled it into mainline bitcoin because it would make it VERY easy for websites to do the wrong thing and treat 0-confirmation transactions as "paid" and because it isn't clear what (if anything) to do when block chain re-organizations happen or transactions are orphaned (double-spent).