My system is to allow a great number of mobiles to connect to the server and may receive messages sent by other users, I have considered two solutions:
1.Use JMS, and create an individual session for each user, and register a MessageListener in each session
2.Use Message-Driven Bean, whenever a user sends a message to others, calls the MDB, which will store the message in the database(Entity Bean or JDBC); to receiver messages, each user will be assigned a Timer class, which will periodic lookup messages in the database

Which of the two is better?