Did you check your database log files to see if anything strange is happening? You do a INSERT INTO index ... in sub invoke_on_contents {...}, but you never do an explicit commit to the database. I guess this is because you rely on the fact the you have DBI AutoCommit on. In fact AFAIK AutoCommit should default to on. Anyway DBI man page says "Explicitly defining the required AutoCommit behavior is strongly recommended and may become mandatory in a later version.". My guess is that AutoCommit on may not be working properly for you, and after a certain number of INSERT (that are not automatically commited) you may end up with some condition of database rollback segment full, and this may causes DBI:ODBC to crash (OK, I don't know why you don't get back any error).
I already had some problem with AutoCommit, so I usually explicitly set AutoCommit to off and then perform an explicit commit when I want.