Sybase module 0.35pre2 released 
Author Message
 Sybase module 0.35pre2 released

WHAT IS IT:

The Sybase module provides a python interface to the Sybase relational
database system.  It supports all of the Python Database API, version
2.0 with extensions.

NOTES:

In this release the module uses callback instead of inline error
handling from the Sybase CT library.  This has caused quite extensive
changes to the threading support inside the low level extension
module.

One of the nice side effects of using callback error handling is that
server errors while executing stored procedures will now be reported
correctly.

FreeTDS support is much improved in this version.

You can build for FreeTDS like this:

     python setup.py build_ext -D HAVE_FREETDS -U WANT_BULKCOPY
     python setup.py install

The module is available here:

    http://www.*-*-*.com/

The module home page is here:

    http://www.*-*-*.com/

CHANGES SINCE 0.35pre1:

* Changed ignored server messages to (5701, 5703).  Thanks to Kevin
  Jacobs.

* Allocate a new CS_COMMAND for each command executed on a cursor.
  This behaves like an explicit close() on the cursor in between
  commands.  This makes it possible to perform multiple .execute()
  commands on a cursor with FreeTDS.

* Added array binding to cursor to gain extra performance.  Set the
  arraysize cursor attribute before executing a command.

* Made connection locking optional.  Sybase.connect(..., locking = 0)

* Native DateTime types now has separate str() and repr().  print
  used to display "'11/01/63'".

ARRAY BINDING:

The following is a little test program to see the performance effect
of array binding in the .fetchmany() cursor method.

It looks like the speed was mostly going in function calls due to
locking and single row fetching.

run             locking array functions time (ave 10 runs)
test-array l          Y     N     88586 1.3248 secs
test-array            N     N     20450 0.9803 secs
test-array al         Y     Y      9458 0.5188 secs
test-array a          N     Y      7262 0.5002 secs

- - test-array.py - - - - - - - - - - - - - - - - - - - - - - - -
import sys, Sybase

def array_bind():
    db = Sybase.connect('SYBASE', 'sa', '', 'sybsystemprocs',
                        locking = do_locking)
    c = db.cursor()
    c.arraysize = 32
    c.execute('select text from syscomments')
    num_rows = 0
    while 1:
        rows = c.fetchmany()
        if not rows:
            break
        num_rows += len(rows)
    print num_rows, 'rows'

def single_bind():
    db = Sybase.connect('SYBASE', 'sa', '', 'sybsystemprocs',
                        locking = do_locking)
    c = db.cursor()
    c.execute('select text from syscomments')
    num_rows = 0
    while 1:
        row = c.fetchone()
        if not row:
            break
        num_rows += 1
    print num_rows, 'rows'

def main():
    if do_array:
        array_bind()
    else:
        single_bind()

do_profile = len(sys.argv) > 1 and sys.argv[1].find('p') >= 0
do_locking = len(sys.argv) > 1 and sys.argv[1].find('l') >= 0
do_array = len(sys.argv) > 1 and sys.argv[1].find('a') >= 0

if do_profile:
    import profile
    profile.run('main()')
else:
    main()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

--
http://www.*-*-*.com/



Fri, 15 Apr 2005 19:36:20 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Sybase module 0.35pre2 released

2. Sybase module 0.30 (Graham Ashton release) released

3. Sybase module 0.24 (Timothy Docker release) released

4. Sybase module 0.13 (Chad Lester release) released

5. Sybase module 0.30 (Graham Ashton release) released

6. Sybase module 0.24 (Timothy Docker release) released

7. Sybase module 0.13 (Chad Lester release) released

8. Sybase module 0.12 (Aki Yamashita release) released

9. Sybase module 0.11 (Sam Rushing release) released

10. Sybase module 0.36 released

11. Sybase module 0.36pre6 released

12. Sybase module 0.36pre5 released

 

 
Powered by phpBB® Forum Software