Issue Details (XML | Word | Printable)

Key: JDBC-455
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Mark Rotteveel
Reporter: Tomasz Kujalow
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Jaybird JDBC Driver

Setting RoleName to emtpy string throws errors

Created: 16/Sep/16 02:34 PM   Updated: 17/Sep/16 05:34 AM
Component/s: None
Affects Version/s: Jaybird 2.2.11
Fix Version/s: None

Environment:
Server: WIN64: Firebird 2.5.3, LNX64: Firebird 2.5.5
Client: WIN64


 Description  « Hide
1) When I set property RoleName to "" (empty string) I get error:
GDS Exception. 335544382. Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long

2) When I test this value by .getRoleName() I get value: true (String "true").

3) When I set null (ROLE=null) or "RDB$ADMIN" (ROLE="RDB$ADMIN") there is no error.

4) When comment out: //dbDriver.setMinPoolSize(3); I get error:
org.firebirdsql.jdbc.FBSQLException: Could not obtain connection during blocking timeout (5000 ms)

The test program showing the error:

package com.progpol.test.firebird;

import java.sql.SQLException;

import org.firebirdsql.jdbc.FirebirdConnection;
import org.firebirdsql.pool.FBWrappingDataSource;



public class BufferEndException {

//GDS Exception. 335544382. Invalid clumplet buffer structure: buffer end before end of clumplet - clumplet too long
private static FBWrappingDataSource dbDriver;
private static FirebirdConnection conn;
private static java.sql.Statement st;
private static java.sql.ResultSet rs;
public static void main(String[] args) {

final String ROLE="";

dbDriver=new FBWrappingDataSource();
dbDriver.setType("TYPE4");
dbDriver.setSqlDialect("3");
dbDriver.setCharSet("UTF-8");
dbDriver.setEncoding("UTF8");
dbDriver.setRoleName(ROLE);
System.out.println("set ROLE=|"+ROLE+"|");
System.out.println("get ROLE=|"+dbDriver.getRoleName()+"|");
dbDriver.setConnectTimeout(1);
dbDriver.setTimestampUsesLocalTimezone(false);
dbDriver.setKeepStatements(false);
dbDriver.setStatementPooling(false);
dbDriver.setPooling(true);
dbDriver.setLoginTimeout(5);
dbDriver.setMaxIdleTime(5000);
dbDriver.setMinPoolSize(3);
dbDriver.setMaxPoolSize(6);
StringBuilder database=new StringBuilder();
database.append("127.0.0.1");
database.append("/"+3050);
database.append(":"+"d:\\database\\database.gdb");
dbDriver.setDatabase(database.toString());
try {
FirebirdConnection conn=(FirebirdConnection)dbDriver.getConnection("SYSDBA","masterkey");
conn.setAutoCommit(false);
String sql = "SELECT count(*) AS FIELD_CNT FROM RDB$FIELDS";
st = conn.createStatement();
rs = st.executeQuery(sql);
if(rs.next()){
int cnt=rs.getInt(1);
System.out.println("return="+cnt);
};
conn.commit();
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
}
}


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Mark Rotteveel added a comment - 17/Sep/16 05:32 AM - edited
As a workaround: don't set the rolename if it is empty.

Also note that FBWrappingDataSource is deprecated and will be removed in Jaybird 3, see http://www.firebirdsql.org/file/documentation/drivers_documentation/java/2.2.11/release_notes.html#removal-of-deprecated-classes-packages-and-interface-methods