SqlAlchemy hangs after adding record in MS SQL
- by Patrick
I'm running SQLAlchemy on Jython and trying to connect to a MS SQL database using jTDS with windows authentication. I can query and delete just fine but when I try to insert new values it will hang when I commit.
int 'before add'
session.add(newVal)
print 'after add'
session.commit()
print 'after commit'
I see the first two print statements but not the last. My CPU maxes out and I can't even query the table directly using the MS SQL Management Studio. When I kill the Jython java process I can query again but the new values haven't been added.
Strangely enough I can insert values directly using an SQL command:
insert_sql = "INSERT INTO my_table (my_value) VALUES ('test_value')"
session.execute(insert_sql)
session.commit()
Any ideas what I'm doing wrong?