-
1. Re: IllegalStateException using CMP and DataSource from Sess
dsundstrom Jul 16, 2002 3:27 PM (in response to febbraro)This is caused by a bad hashCode or equals method in a custom primary key class.
-
2. Re: IllegalStateException using CMP and DataSource from Sess
febbraro Jul 16, 2002 4:19 PM (in response to febbraro)One way I was able to fix it was by making the TXN of the method that contains the operations "Required".
Also, I generate the PK class using XDoclet, I appears to be a good Key class in terms of hashCode and equals.
Anything else I could look at?
The actual steps after reading my first post are,
1) Call CMP EJB methods (getXxxx1, getXxxx2, ...)
2) DataSource.getConnection()
3) getXxxx3 -
3. Re: IllegalStateException using CMP and DataSource from Sess
dsundstrom Jul 16, 2002 5:13 PM (in response to febbraro)Oh you weren't running with a transaction. If you want to do that, you need to run the cvs code, and then I still don't guarantee it works. Running without a tx is not something I recommend, as the overhead of a tx is very small.
-
4. Re: IllegalStateException using CMP and DataSource from Sess
febbraro Jul 17, 2002 9:46 AM (in response to febbraro)So would you recommend that every method on my Session beans run with a transaction?
-
5. Re: IllegalStateException using CMP and DataSource from Sess
dsundstrom Jul 17, 2002 4:55 PM (in response to febbraro)I would, but this is just my opinion. Most people confuse transaction with locking, and it is the locking that impacts preformance. JBoss allows you to turn off locking for some readonly methods, but I don't know exactally how you do it (Bill Burke's code).
If you want to run without a cmp 2.0 entity without tx, you will need to use the cvs Branch_3_0 code, because there was a bug in the 3.0 release.