• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple email notifications for new messages in a forum topic

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello there,

My company is using JForum (2.1.7) to provide customer support for our products.

One of our users is reporting that he is receiving 3-4 of the same notification emails every time a new message is posted in a forum topic he is watching.

I took a look at our JForum database, and noticed that in the jforum_topics_watch table, his user_id is associated with the same topic_id 3-4 times for all the topic_ids he is watching.

The odd thing is that other users, including myself, are not running into this problem.

Any idea of why this is happening and how we can fix it/prevent it from happening?
[originally posted on jforum.net by madjaguar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your database supports it, you can define a Unique Index with both the User_Id and Topic_ID (or Forum_ID) fields.
This will prevent any double entries into the watch tables.

However, your user might see some nasty error messages if the code tries to do a double entry. (But this will also help find what's causing it...)
[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply!

I've just added the unique constraint, so we'll see what happens.

If we or our users start running into error messages, I'll post details here.
[originally posted on jforum.net by madjaguar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again,

Someone has reported an error when posting to the forum. I'm not 100% certain if it was caused by the newly added unique key constraint, but here's the stacktrace that they gave.



Let me know if you require further information.
[originally posted on jforum.net by madjaguar]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think it's related unless the tool you used to update the tables has locked the DB somehow.

The underlying cause is that there is a pending transaction in the DB. In particular, the call being made is:

GenericUserDAO.incrementPosts

This is doing an Update to the jforum_users table and not any of the watch tables.

This could be a transient problem with some process just holding on to a lock at the wrong time for too long. Or it might indicate that somewhere some code is creating a deadlock situation. E.g., process X is waiting on Y who is waiting on Z who is waiting on X....


[originally posted on jforum.net by monroe]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm from the same place as madjaguar...

Thanks for your help so far; I think we're getting close to the answer.

I can see why you'd think from that stack trace that the database was locked, but that's not the case here. We're using PostgreSQL on the backend, and that error message means a previous statement within the current transaction has failed. In PostgreSQL, within a transaction, once a statement has failed, every subsequent statement until the next rollback will get that error.

I found the revelant information from the server log. Unfortunately, there is no stack trace for the initial error, which does appear to be due to the new unique constraint:


So the stack trace posted earlier (which I have snipped out here) is just fallout from the real problem, for which we don't have a stack trace.

Any ideas?

-Jonathan
[originally posted on jforum.net by jfuerth]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic