We need to use some legacy code (C and Python code) that is not re-entrant, it must run in it's own process. We are going to be using it from an EJB, and the EJB will need to spawn a new process and run the code, keeping it alive for the lifetime of the EJB and killing it when the EJB is finished. But I am having trouble figuring out if it should be an Entity Bean or a Session Bean. There should be one instance of this code for each logged in user, it performs a large chunk of the application logic that they will be using while logged on, which would point towards using a Session Bean, but it's state should be persisted between sessions (to a database, as a BLOB). So the fact that it basically represents and manipulates a row of data in the database seems to indicate that it should be an Entity bean. The problem is, if I understand everything correctly, we don't really have control over the lifecycle of an entity bean instance, and since spawning a new process and loading data into it is fairly expensive we need to ensure that it doesn't happen more often than is necessary, for example the container could decide to activate and passivate entity bean instances as often as it wants and there's no way we can control it. So which way should we go with this? Any potential problems with this? Any thoughts would be appreciated. Thanks, Paul ps - I realize that this may be against the EJB spec, but I'm sure our EJB container will allow it. =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
