sijms / go-ora

Pure go oracle client
MIT License
767 stars 168 forks source link

Received code N error after using for a period of time #523

Closed Niexiawei closed 3 months ago

Niexiawei commented 4 months ago

error

310343659-e7861afa-4ef1-4526-97a0-0af887096bc0

code

//connection
options := map[string]string{
        "TIMEOUT":  "300",
    }
    if val := viper.GetString("database.oracle.sid"); val != "" {
        options["SID"] = val
    }
    dsn := go_ora.BuildUrl(viper.GetString("database.oracle.host"),
        viper.GetInt("database.oracle.port"),
        viper.GetString("database.oracle.service"),
        viper.GetString("database.oracle.user"),
        viper.GetString("database.oracle.pwd"), options)

    conn, err := sql.Open("oracle", dsn)
    conn.SetMaxIdleConns(50)
    conn.SetMaxOpenConns(50)
    if err != nil {
        panic(err)
        return
    }
    OracleConn = conn

//Query

rows, err := OracleConn.Query("select * from GCJL where GCSJ >= to_date(:1,'yyyy-mm-dd hh24:mi:ss') and GCSJ <= to_date(:2,'yyyy-mm-dd hh24:mi:ss')", "2024-03-05 00:00:00","2024-03-05 02:00:00")
    if err != nil {
        return nil, err
    }
    defer rows.Close()
    columns, err := rows.Columns()
    if err != nil {
        return nil, err
    }
    for rows.Next() {
        res := make([]any, len(columns))
        _ = rows.Scan(res...)
    }
sijms commented 3 months ago

fixed in v2.8.11 (fix regression occur in encryption and data integrity)

Niexiawei commented 2 months ago

thanks