More to mention about MDBs (Message Driven Beans):
1. Always use @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
on public void onMessage(Message message).
because the impl of Resin MDBs has severe reenter synchronization problem.
If I start a transaction before onMessage() being cal
I will not call UserTransaction.begin() when all db operations are SELECT.
I create a EntityManager from emf to do SELECT stuff with no transaction at
all.
When I detected there're some update/delete operations, I'll do this:
1. close the former created EntityManager if there is one (for precedent
On 30-Mar-2010 18:03, Scott Ferguson wrote:
> Wesley Wu wrote:
>
>> Yes. One minor problem:
>>
>> @PersistentContext should be @PersistentUnit.
>>
> would calling UserTransaction in your code be faster? Essentially,
>
I don't know about the finer details, but looking back on this
On 30-Mar-2010 17:54, Wesley Wu wrote:
> Yes. One minor problem:
>
> @PersistentContext should be @PersistentUnit.
>
Doh!
Great, works now. Thanks for your help!
___
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mail
Wesley Wu wrote:
> Yes. One minor problem:
>
> @PersistentContext should be @PersistentUnit.
>
>
> That's exactly what I used to do in the past three years.
>
> I controlled the entitymanager and transaction by my own code in a JPA
> wrapper class,
> and gained great performance advantage over aut
Yes. One minor problem:
@PersistentContext should be @PersistentUnit.
That's exactly what I used to do in the past three years.
I controlled the entitymanager and transaction by my own code in a JPA
wrapper class,
and gained great performance advantage over automatic transaction handling
like @
On 30-Mar-2010 09:34, Wesley Wu wrote:
> To make set method auto translated into a UPDATE clause, the
> entitymanager should be opened after a transaction begins.
>
>
Sincere thanks again, hopefully this will all help others coming across
it in the future.
If I understood you correctly I made
To make set method auto translated into a UPDATE clause, the
entitymanager should be opened after a transaction begins.
@PersistenceUnit(unitName="example")
EntityManagerFactory emf;
EntityManager em;
try {
ut.begin();
EntityManager em= emf.createEntityManager();
CourseBean u
On 30-Mar-2010 06:42, Wesley Wu wrote:
> try {
> ut.begin();
> CourseBean updateCourse = _manager.find(CourseBean.class, new
> Integer(1));
> updateCourse.setCourse("Magic");
> ut.commit();
> } catch (Exception e) {
> e.printStackTrace();
>
try {
ut.begin();
CourseBean updateCourse = _manager.find(CourseBean.class, new
Integer(1));
updateCourse.setCourse("Magic");
ut.commit();
} catch (Exception e) {
e.printStackTrace();
}
will work.
-Wesley
__
On 29-Mar-2010 17:48, Scott Ferguson wrote:
Wesley Wu wrote:
Not a version issue.
An entitymanager should not get transaction by itself. Transaction in
a modern java appserver should be XA or JTA transaciton.
An entitymanager will detect if there is a JTA transaction existing
and will join
Wesley Wu wrote:
> Not a version issue.
>
> An entitymanager should not get transaction by itself. Transaction in
> a modern java appserver should be XA or JTA transaciton.
> An entitymanager will detect if there is a JTA transaction existing
> and will join it if there is an open one.
>
> You need
Not a version issue.
An entitymanager should not get transaction by itself. Transaction in
a modern java appserver should be XA or JTA transaciton.
An entitymanager will detect if there is a JTA transaction existing
and will join it if there is an open one.
You need to use an injected UserTransac
On 27-Mar-2010 01:10, Stargazer wrote:
> Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
> I'd like to take it to the next level and persist something.
> Adding
> EntityTransaction tx = _manager.getTransaction();
> tx.begin();
> ...
> to the en
Also, the link at the very bottom of that page gets a 500 error:
http://www.caucho.com/resin/examples/amber-basic/index.xtp
> 500 Servlet Exception
>
> 'ejb3_basic_courses' is not a valid database table. Either the table needs
> to be created or the create-database-tables attribute must be set.
Resin 4.0.5 - following http://wiki.caucho.com/Hibernate works fine, but
I'd like to take it to the next level and persist something.
Adding
EntityTransaction tx = _manager.getTransaction();
tx.begin();
...
to the end of the CourseServlet.java file throws up
java.lang.I
16 matches
Mail list logo