I have some utility functions which may be called from multiple Stateless Session EJBs. These utility functions needs to be in a new transaction (RequiresNew
).
Does it make sense to create one Stateless Session EJB for all these functions may be call it Utility
?
Or should I try to have them organized by functionality in which case I will end up with multiple Stateless Session EJBs? What will be the impact on performance of system if I have lot of such Stateless Session EJBs?
Some examples of utility functions:
I have a table where I store messages with Id. Create a utility function to retrieve a message for a specific Id. Create a utility function to update a message for a specific Id.
I have a table where I keep track of statuses of some processes. Create a utility function to give status of a specific Process. Create a utility function to update status of a specific Process.
etc.