I'm implementing the file copy method in FileDao. It is running in read-only mode though, so it is giving me errors. So question is, how to switch it to write mode? Any pointers?
Here's the relevant parts of the error:
2010-11-23 15:36:32,319 ERROR ExceptionResolver: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
2010-11-23 15:36:32,319 ERROR ExceptionResolver: org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.
And snippets of the code:
public File copyFile( File file ) throws IOException
{
File fileClone = new File(file);
...
saveFile(fileClone);
if (file.isFolder())
{
for (File f : listFiles(file))
{
File clone = copyFile(f);
...
saveFile(clone);
}
}
else
{
...
}
return fileClone;
}