Hey fellas,
I'm working in a system that uses EJB and JDBC for persistence. I don't have Entity Beans for all the tables, so let's say that when the busines logic requires data creation between 2 tables (1 to N): the first got an Entity Bean, and the other don't. When my Session Bean is called to persist data using this 2 tables, should I use the Entity Bean to store data into the first table, and JDBC to store into the second one, right?
The issue is that I'm getting deadlock into the database when I do that, the application get frozen and nothing happens. I think it could be a problem with the transactions...
I solved that extracting the business logic from the Session Bean and inserting into my Data Access Object (saving firt using the Entity Bean, and after JDBC with different method from Session Bean), but I don't think that's the best way to do it.
Do you have any idea to do it better?
Thanks!
I'm working in a system that uses EJB and JDBC for persistence. I don't have Entity Beans for all the tables, so let's say that when the busines logic requires data creation between 2 tables (1 to N): the first got an Entity Bean, and the other don't. When my Session Bean is called to persist data using this 2 tables, should I use the Entity Bean to store data into the first table, and JDBC to store into the second one, right?
The issue is that I'm getting deadlock into the database when I do that, the application get frozen and nothing happens. I think it could be a problem with the transactions...
I solved that extracting the business logic from the Session Bean and inserting into my Data Access Object (saving firt using the Entity Bean, and after JDBC with different method from Session Bean), but I don't think that's the best way to do it.
Do you have any idea to do it better?
Thanks!