> -----Original Message-----
> From: jochen mader [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 03, 2001 2:34 PM
> To: [EMAIL PROTECTED]
> Subject: Problem with transactiontimeout
> 
> 
> Hey,
> I'm using JOnAS to create manymany entitybeans (about 10-20 a 
> second), no 
> problem with that. 
> The problem starts when I try to remove timedout beans. I 
> wrote a little 
> session bean to do the work for me (getting an Enumeration from the 
> findermethod of the entitybean and then starting a while loop 
> to remove 
> them). It's working as  long as there are only view beans 
> that have to be 
> removed (20-30), but as soon as there are more beans I run 
> into a timeout and 
> a rollback occurs. No problems with that (it's ment to work 
> that way), but 
> does anybody know how I could speed up the deletion of large 
> numbers of 
> beans? Or is it possible to keep a transaction open as long 
> as required?

Do it this way:

        Context initialContext = new InitialContext();

        utx =
(UserTransaction)PortableRemoteObject.narrow(initialContext.lookup
                        ("javax.transaction.UserTransaction"),
UserTransaction.class);

        utx.setTransactionTimeout(60 * 60); // in seconds
        utx.begin();

        // your long lasing code

        
        utx.commit(); 
        // utx.rollback() in case of error


Max

> 
> Thanks in advance
> 
> Jochen
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
> 
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to