Open topic with navigation

TIBCO® Patterns 6.1.2

# Transactions Example

Create a character map and a table, and commit or roll them back together.

    lpar_t   tran ;   /* the transaction id parameters. */
    dvkerr_t err ;    /* return status of Devkit function calls */
    /* parameters for character map creation */
    lpar_t host ;
    lpar_t mapname ;
    lpar_t mapdef ;
    /* parameters for table creation */
    lpar_t dbname;
    lpar_t dbpars;
    lpar_t dbstats;
    dbname = lpar_create_str(LPAR_STR_DBDESCRIPTOR, "dbname");
    host = lkt_host_lpar( "localhost", 5051);
    /* population of other parameters omitted */
    /* create transaction, storing tran id in tran variable */
    err = lkt_tran_create(host, LPAR_NULL, &tran) ;
    if ( ! DVKERR(err) ) {
        /* create character map */
        err = lkt_create_charmapT(host, mapname, tran, mapdef);
        if ( ! DVKERR(err)) {
            /* create table */
            err =lkt_dbloadT(host, dbname, tran, dbpars, reclist, &dbstats);
        }
        /* commit or abort */
        if ( DVKERR(err) ) {
            err = lkt_tran_abort(host, tran, LPAR_NULL);
        } else {
            err = lkt_tran_commit(host, tran, LPAR_NULL);
        }
    }

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO® Patterns

Copyright © 2010-2025. Cloud Software Group, Inc. All Rights Reserved.