-
1. Re: Problem with Entity Bean
allanrj Mar 27, 2008 5:44 PM (in response to allanrj)well this error persist .... how can i solve this ??
problem on ejb or configuration of jboss ? -
2. Re: Problem with Entity Bean
frankthetank Mar 28, 2008 10:59 AM (in response to allanrj)Sounds more like you have an entity with two primary keys.
Look if you have @Id defined twice or something like that. -
3. Re: Problem with Entity Bean
allanrj Mar 28, 2008 11:10 AM (in response to allanrj)Well,
I using a ejb to persisting the session, when i log in the ejb has been created.
I´m close browser and try log in again, but exception has appeared.
I think jboss doesnt destroy/remove my earlier ejb. This persists on memory
or cache, i dont know -
4. Re: Problem with Entity Bean
allanrj Mar 31, 2008 9:04 AM (in response to allanrj)Im using ejb 2.0 on my application. Im using a session bean (façade) to access entity bean. I have follow entity: Session, to manage a user session.
Well, when i logon, jboss using the follow commands:
2008-03-31 10:00:05,269 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Sessions] Executing SQL: SELECT COUNT(*) FROM SESSIONS WHERE sessionid=?
2008-03-31 10:00:05,285 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Sessions] Executing SQL: INSERT INTO SESSIONS (sessionid, sessioninsertdate, sessionupdatedate, sessionipnumber, userid, sessionipforwarded, sessionclientbrowser, sessioncookieid, siteid) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
2008-03-31 10:00:05,285 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreEntityCommand.Sessions] Executing SQL: UPDATE SESSIONS SET sessioninsertdate=?, sessionupdatedate=?, sessionipnumber=?, userid=?, sessionclientbrowser=?, siteid=? WHERE sessionid=?
Then, I close browser and try logon again and jboss do:
2008-03-31 10:01:19,013 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.Sessions] Executing SQL: SELECT COUNT(*) FROM SESSIONS WHERE sessionid=?
And trow a exception:
javax.ejb.DuplicateKeyException: Entity with primary key br.com.gcm.ejb.cmp.SessionsKey@a78a01aa already exists
Well my doubt is:
Why object stay at memory after i close a browser ? Jboss dont manager this right ok ?