
|
If you were logged in you would be able to see more operations.
|
|
|
|
Both a JobDetail's and a Trigger's listeners are list based, which means they allow the same listener to be added multiple times. If you are using a RAMJobStore, this will be allowed and the same listener will simply be invoked multiple times. However, if you are using a JDBC JobStore, then you will get a unique constraint violation when Quartz tries to store the same listener name multiple times for the same Trigger/JobDetail in the database.
To make this behavior consistent, I suggest enforcing the listener name uniqueness when a new listener is added, throwing an IllegalArgumentException if there is a duplication.
To do this efficiently, we should switch the listener lists to ordered sets. Unfortunately, LinkedHashSet wasn't introduced until Java 1.4, so to maintain 1.3 compatibility I suggest using the commons collection ordered set via org.apache.commons.collections.SetUtils.orderedSet(Set).
Note: JobDetail does implement java.io.Serializable which means this change will break backwards serializablity. If this is important we can keep the jobListeners as a List, and use its less efficient contains() method to enforce uniqueness. However, I don't under what circumstance JobDetail would be serialized so this is likely safe.
|
|
Description
|
Both a JobDetail's and a Trigger's listeners are list based, which means they allow the same listener to be added multiple times. If you are using a RAMJobStore, this will be allowed and the same listener will simply be invoked multiple times. However, if you are using a JDBC JobStore, then you will get a unique constraint violation when Quartz tries to store the same listener name multiple times for the same Trigger/JobDetail in the database.
To make this behavior consistent, I suggest enforcing the listener name uniqueness when a new listener is added, throwing an IllegalArgumentException if there is a duplication.
To do this efficiently, we should switch the listener lists to ordered sets. Unfortunately, LinkedHashSet wasn't introduced until Java 1.4, so to maintain 1.3 compatibility I suggest using the commons collection ordered set via org.apache.commons.collections.SetUtils.orderedSet(Set).
Note: JobDetail does implement java.io.Serializable which means this change will break backwards serializablity. If this is important we can keep the jobListeners as a List, and use its less efficient contains() method to enforce uniqueness. However, I don't under what circumstance JobDetail would be serialized so this is likely safe. |
Show » |
| There are no comments yet on this issue.
|
|