Hi folks,
I'm playing around with the mysql backend option and have two quick questions. These could be and probably are just issues on my end due to endless tinkering:
- On the first startup with an empty database, hibernate initializes the schema correctly, but the ScannerMappingUpdaterService quickly starts inserting records imported from /mapping/*.csv, before it's possible to import the 'import.sql'. This throws the data out of whack and you have to start over. My workaround was to build an import file that initializes the schema and loads import.sql so that hibernate doesn't have to deal with any of that.
- I'm getting a lot of errors related to methods being marked '@Transactional(readOnly = true)' in the code. One example is viewing the vulnerability list after an import. According to the log, it's trying to update some GenericVulnerability objects, but it's wrapped with a readOnly = true transaction and fails. I just went through and marked everything 'readonly = false', which has the desired effect, but at some cost in security.
Lastly, just a note, disabling autocommit in the import.sql file improves import time substantially.
I'm up and running now, so i guess i'm just sharing this info. Let me know if you would like me to try anything.
Thanks!