I hope someone here can help.  I tried SQLAlchemy and they think it
might be a TG2 usage issue.

I am having problems getting my data to save when the changes are made
through stored procedures.
I created a sample block of code below to show exactly how I am
implementing this.  This code is in a method of my controller.

<code>
from sqlalchemy import sql
import transaction

... class definition ...

    @expose()
    def test_v1(self,**kargs):
        conn = DBSession.connection()
        statement = sql.text("""CALL insert_test(321, 1);""")
        results = conn.execute(statement).fetchall()
        # The result set will have the new primary key value.
        if results == []:
          return None
   
          newID = results[0][0]
        transaction.commit()
        return "" + newID
</code>

The return value indicates a nice integer.  And if I keep calling the
code over again, the return value increases by 1.  Further indicating
the INSERT statement contained within the stored procedure is working
correctly.

Maybe the transaction is not realizing there were any mods since I did
everything through the stored procedure?

Does anyone have an idea of how to get around this?

Thanks.
-Rodney


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to