I found it won't auto reconnect at this situation:
from dal import DAL
from dal import Field
import time
db = DAL("mysql://root:[email protected]/mydb")
db.define_table("table1",
Field("name"),
migrate = False
)
db.table1.insert(name="jim")
db.commit()
# Close the connection from mysql server
# error will be raised
# the error is somthing like "connection lost during query"
# and dal didn't reconnect at all
time.sleep(10)
# the connection is closed, and error occured when insert
db.table1.insert(name="tom")
db.commit()
print "done"
On 1月13日, 下午9时36分, Vasile Ermicioi <[email protected]> wrote:
> if the connection is lost web2py tries to reconnect (5 times )