well.

you can create a new thread at the beginning of your Application. This
thread class will have a synchronizedQueue member, for storing chat
messages, and will enter an infinite loop once run. In the infinite
loop, i mean somehing like; if the queue is not empty, pop from the
queue, insert it into sql. then check again. if the queue is empty,
put thread into sleeping state (for 1 sec, or infinite).

In your application, when a chat message arrives, push the message
into the other thread's synchronizedQueue, and wake the thread. And go
on what you're doing, publish the chat message to other users, etc.

-kerem

On 8/21/06, Thomas Williams <[EMAIL PROTECTED]> wrote:
> Hi chaps,
> My apoligies for the off topic, however this is the list that will most
> likely be able to answer this.
>
> Our application will be sending user data to the red5 server, which in
> turn may be stored in a database. For example one part of our
> application includes a logged chat server (the logging is going into the
> database).
>
> We were wondering what techniques we could use to make sure that when a
> user sends a chat message to the server that they do not have to wait
> for the entire SQL statement to complete before they received a response
> (All that would be going into the database would be logging, so the user
> would not need to know the result of the query, be it success or
> failure). Because the planned usage of this database will be quite high,
> queries could be waiting a significant amount of time to gain a write
> lock.
>
> We have investigated the hibernate framework [hibernate.org], and
> although it offers many refinements it doesn't directly address this
> problem.
>
> So, does anyone else have any elegant solutions for this kind of
> problem?
>
> Best regards,
> Tom
>
>
> _______________________________________________
> Red5 mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/red5_osflash.org
>

_______________________________________________
Red5 mailing list
[email protected]
http://osflash.org/mailman/listinfo/red5_osflash.org

Reply via email to