Is there any way round this ? I'm about to add transaction support but I use an administrator session to retrieve an acl from the content to decide wether the user has access to the node or not. How has everyone else dealt with this problem ? I guess I would have to change the code to do the access check prior to starting the transaction ?
On 7/2/07, KÖLL Claus <[EMAIL PROTECTED]> wrote:
the only thing you must looking for not to open 2 sessions in 1 transaction ! maybe you are opening a adminsession in the accessmanager ? even if you do only reading with the second session you will get a timeout exception ! the locking strategy is at the moment designed not to allow 2 sessions in one transaction ! BR, claus -----Ursprüngliche Nachricht----- Von: Mihai Anescu [mailto:[EMAIL PROTECTED] Gesendet: Montag, 02. Juli 2007 10:51 An: [email protected] Betreff: RE: JBoss JTA transaction timeout Hi Klaus, It is similar, but a little different. We have an upload method and one download method. Each one is called on it's own, opens a session, does some stuff. The upload method will create some nodes and put the content from a stream into a node. The download method just retrieves one such node and returns an object "describing it" (content, mimetype, filename). I have moved the second method into a different object, one that is not an EJB (I made a helper class). Both mehods are called from a Home class, one that manages the operations for one entity. And I still got the same error, for the download method only. I even tried to add a dummy node when I do the retrieving, but the same error shows up every time. I have an entity with 3 upload controls, I can upload all three files but I get the same error for all 3 download... We're using JackRabbit 1.3. -----Original Message----- From: KÖLL Claus [mailto:[EMAIL PROTECTED] Sent: Monday, July 02, 2007 8:34 AM To: [email protected] Subject: AW: JBoss JTA transaction timeout hi mihai, maybe you have the same problem as here described .. http://issues.apache.org/jira/browse/JCR-769 BR, Claus -----Ursprüngliche Nachricht----- Von: Mihai Anescu [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 29. Juni 2007 15:52 An: [email protected] Betreff: JBoss JTA transaction timeout Hi, I have this situation/problem: We are using JBoss Seam, I have a Stateless EJB configured to do all the work for the JackRabbit repository, and I have a method that just retrieves content (files that were previously added by other methods). So, the flow would be: 1) Load the entity 2) Get a reference to the stateless EJB 3) Call the method to retrieve the content 4) If something is found I put a download button on the interface The content in the repository is linked to the entity (via an XPath composed from the entity type + hierarchy + id) So in the step 3 method, I open a session, and call some methods: Session session = getSession(); Node node = retrieveNode(session, path); Node content = null; if (node.hasNode(JCR_CONTENT)) { content = node.getNode(JCR_CONTENT); ... I just read content from the repository, I don't add/modify anything! But when the method is called I get: [org.apache.jackrabbit.core.TransactionContext] Transaction rolled back because timeout expired. So what's the cause? If I use session.logout() then I get another exception, I read somewhere that the session attaches itself to the current JTA transaction. Regards, Mihai
