Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting RoleName to emtpy string throws errors [JDBC455] #494

Closed
firebird-automations opened this issue Sep 16, 2016 · 3 comments
Closed

Comments

@firebird-automations
Copy link

Submitted by: Tomasz Kujalow (tkujalow)

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\(\);
	\}
\}

}

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

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

@mrotteveel
Copy link
Member

Added tests to verify this doesn't happen anymore.

@mrotteveel
Copy link
Member

NOTE: The "cannot reproduce" label was added to reflect that this behaviour no longer occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants