forked from openlp/openlp
Fix bug 1154467
This commit is contained in:
parent
5e9d9a3cd0
commit
056a7b72ed
@ -32,9 +32,11 @@ import logging
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import time
|
||||||
|
|
||||||
from PyQt4 import QtCore
|
from PyQt4 import QtCore
|
||||||
from sqlalchemy import Column, ForeignKey, Table, or_, types, func
|
from sqlalchemy import Column, ForeignKey, Table, or_, types, func
|
||||||
|
from sqlalchemy.exc import OperationalError
|
||||||
from sqlalchemy.orm import class_mapper, mapper, relation
|
from sqlalchemy.orm import class_mapper, mapper, relation
|
||||||
from sqlalchemy.orm.exc import UnmappedClassError
|
from sqlalchemy.orm.exc import UnmappedClassError
|
||||||
|
|
||||||
@ -235,7 +237,12 @@ class BibleDB(QtCore.QObject, Manager, RegistryProperties):
|
|||||||
text=verse_text
|
text=verse_text
|
||||||
)
|
)
|
||||||
self.session.add(verse)
|
self.session.add(verse)
|
||||||
self.session.commit()
|
try:
|
||||||
|
self.session.commit()
|
||||||
|
except OperationalError:
|
||||||
|
# Wait 10ms and try again.
|
||||||
|
time.sleep(0.01)
|
||||||
|
self.session.commit()
|
||||||
|
|
||||||
def create_verse(self, book_id, chapter, verse, text):
|
def create_verse(self, book_id, chapter, verse, text):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user