cancel
Showing results for 
Search instead for 
Did you mean: 

Session / Transaction Management - FlushMode.NEVER

cjames
Champ in-the-making
Champ in-the-making
I am getting this message, and I have scoured through all of the posts to try not to get beat up too bad as a first-time poster…

==============
Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition
==============

I understand that this is a hibernate thing, but it seems that Alfresco is using Springs Transaction layer, and how the config files are layed out, I am at a loss to know where to change
this.

http://www.hibernate.org/hib_docs/api/net/sf/hibernate/FlushMode.html

- Jdk 1.5 / Tomcat 5.0.28
- Alfresco 1.1.2 - war install version
3 REPLIES 3

kevinr
Star Contributor
Star Contributor
I think this is a bug that appears on some systems, from the web-client code that is using the wrong transaction setting. Does the message appear when you first login? If so then it's the problem. It's been fixed in the SVN codebase. To fix it before the next release, you can download the Alfresco Source, build and patch it on your machine:

In the class:
org.alfresco.web.bean.UserShortcutsBean

and the method:
public List<Node> getShortcuts()

change this line:
tx = Repository.getUserTransaction(context, true);

to this:
tx = Repository.getUserTransaction(context);

Or if you are happy using Subversion to update your source, then update to SVN revision 2074.

Sorry about that,

Kevin

omegerard
Champ in-the-making
Champ in-the-making
I get this error with a new installation of enterprise version 1.2.1.

And the source cannot be downloaded for making the necessary amendments.

So what am I supposed to do?

Ludo

omegerard
Champ in-the-making
Champ in-the-making
I do think I know why I get this error message.

As I am upgrading from an earlier version, I have legacy config information in the system. One of these legacy items is the "guest" role, that is given to EVERYONE at the root space. When I try to remove it I get the error message reported on here.

I should make clear that the "Guest" role is presented as: "$$http://www.alfresco.org/model/content/1.0}cmobject.Guest$$

I firsttried to add that role in the model again (same as Consumer), but that was not sufficient. (same error).

Then I found that the 1.2.1 distribution has some patches for this Guest issue. However, these patches appear not to apply automatically. The logfile at startup says that that there are no patches required:
16:27:14,062 INFO  [admin.patch.PatchExecuter] Checking for patches to apply …
16:27:14,135 INFO  [admin.patch.PatchExecuter] No patches were required.
Which is not true, if you's askme, but who am I compared to Alfresco?

Ludo