Skip to content
  • Sponsor FirebirdSQL/firebird

  • Notifications You must be signed in to change notification settings
  • Fork 231
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

Alternative or solution for ON EXTERNAL DATA SOURCE in Linux firebird 5.0 arm64. #8464

Open
Jhironsel opened this issue Mar 8, 2025 · 8 comments

Comments

@Jhironsel
Copy link

Jhironsel commented Mar 8, 2025

The following trigger gives me a connection error.

SET TERM ^ ;
CREATE OR ALTER TRIGGER SYSTEM_SHAREWARE ACTIVE
ON CONNECT POSITION 0
AS
DECLARE VARIABLE comando D_VARCHAR_1024;
DECLARE VARIABLE entrada D_BOOLEAN_T;
DECLARE VARIABLE c_Fchi D_FECHA;
DECLARE VARIABLE c_Fcha D_FECHA;
DECLARE VARIABLE c_Fchv D_FECHA;
BEGIN
    IF(CURRENT_ROLE <> 'RRR_SOFTSURENA')THEN
    BEGIN
        comando = 'SELECT FCHI, FCHA, FCHV FROM SP_V_E_S_SYS(?);';
        entrada = TRUE;
        
        FOR EXECUTE STATEMENT (comando) ((select RDB$GET_CONTEXT('SYSTEM', 'DB_GUID') from RDB$DATABASE))
        ON EXTERNAL 'registros.db'
        AS USER 'SYSDBA'
        PASSWORD '1'
        INTO
        :c_Fchi, c_Fcha, c_Fchv
        DO BEGIN
            
            IF(CURRENT_DATE < c_Fchi)THEN
                EXCEPTION E_FECHA_INICIAL_INCORRECTA;
                
            IF(CURRENT_DATE < c_Fcha)THEN
                EXCEPTION E_FECHA_ACTUAL_INCORRECTA;
                
            IF(CURRENT_DATE > c_Fchv)THEN
                EXCEPTION E_FECHA_VENCIMIENTO;
            
            UPDATE V_T_E_S_SYS SET 
                FCHI = :c_Fchi,
                FCHA = :c_Fcha,
                FCHV = :c_Fchv;
                
            entrada = FALSE;
        END
                
        IF(entrada) THEN
            EXCEPTION E_EQUIPO_NO_REGISTRADO;
    END
END
^
SET TERM ; ^

OutPut:

Image

@hvlad
Copy link
Member

hvlad commented Mar 10, 2025

Please, provide reproducible test case.

@asfernandes
Copy link
Member

Is the problem arm64 specific or did you tested only on it?

@Jhironsel
Copy link
Author

Problems is ARM64 ubuntu arm64 on oracle VPS. Free tier.

@Jhironsel
Copy link
Author

`
import java.sql.SQLException;
import java.util.logging.Level;
import org.firebirdsql.event.DatabaseEvent;
import org.firebirdsql.event.FBEventManager;
import org.firebirdsql.gds.impl.GDSType;
import org.firebirdsql.gds.ng.WireCrypt;
import sur.softsurena.entidades.Almacen;
import sur.softsurena.formularios.frmAlmacenes;
import sur.softsurena.formularios.frmClientes;
import static sur.softsurena.formularios.frmClientes.llenarTablaCorreos;
import static sur.softsurena.formularios.frmClientes.llenarTablaDirreciones;
import static sur.softsurena.formularios.frmClientes.llenarTablaTelefonos;
import sur.softsurena.formularios.frmDeudas;
import static sur.softsurena.formularios.frmProductos.llenarTablaProductos;
import static sur.softsurena.formularios.frmUsuarios.llenarTablaUsuarios;
import static sur.softsurena.utilidades.Utilidades.LOG;

public class FirebirdEventos extends FBEventManager {

public FirebirdEventos(){
    super(GDSType.getType("PURE_JAVA"));
    setUser("sysdba");
    setPassword("1");
    setServerName("Oracle VPS Free Tier");
    setPortNumber(3050);
    setDatabaseName("aliasDB");
    setCharSet("UTF8");
    setWireCryptAsEnum(WireCrypt.ENABLED);
    
    try {
        connect();
    } catch (SQLException ex) {
        LOG.log(
                Level.SEVERE,
                ex.getMessage(),
                ex
        );
        throw new ExceptionInInitializerError("No pudo conectarse.");
    }
}

public static void main(String[] args) {
    FirebirdEventos eventos = new FirebirdEventos();
    
    eventos.registro();
}

public synchronized boolean registro() {
    try {
        //Evento para productos.********************************************
        addEventListener( "EVENT_PRODUCTO", (DatabaseEvent event) -> {
            LOG.log(
                    Level.INFO,
                    "Event [{0}] occured {1} time(s)",
                    new Object[]{event.getEventName(), event.getEventCount()}
            );
            llenarTablaProductos("evento");
        });
    } catch (SQLException ex) {
        LOG.log(
                Level.SEVERE,
                ex.getMessage(),
                ex
        );
        return false;
    }
    return true;
}

}
`

mar 14, 2025 6:04:06 P.�M. sur.softsurena.FirebirdEventos.FirebirdEventos registro GRAVE: Error writing data to the connection. [SQLState:08006, ISC error code:335544727] java.sql.SQLException: Error writing data to the connection. [SQLState:08006, ISC error code:335544727] at org.firebirdsql.gds.ng.FbExceptionBuilder$Type$1.createSQLException(FbExceptionBuilder.java:618) at org.firebirdsql.gds.ng.FbExceptionBuilder$ExceptionInformation.toSQLException(FbExceptionBuilder.java:571) at org.firebirdsql.gds.ng.FbExceptionBuilder.toSQLException(FbExceptionBuilder.java:309) at org.firebirdsql.gds.ng.wire.version10.V10AsynchronousChannel.connect(V10AsynchronousChannel.java:111) at org.firebirdsql.gds.ng.wire.version10.V10Database.initAsynchronousChannel(V10Database.java:473) at org.firebirdsql.gds.ng.wire.AbstractFbWireDatabase.queueEvent(AbstractFbWireDatabase.java:234) at org.firebirdsql.event.FBEventManager$GdsEventHandler.register(FBEventManager.java:537) at org.firebirdsql.event.FBEventManager.registerListener(FBEventManager.java:430) at org.firebirdsql.event.FBEventManager.addEventListener(FBEventManager.java:378) at sur.softsurena.FirebirdEventos.FirebirdEventos.registro(FirebirdEventos.java:73) at sur.softsurena.FirebirdEventos.FirebirdEventos.main(FirebirdEventos.java:49) Caused by: java.net.ConnectException: Connection timed out: connect at java.base/sun.nio.ch.Net.connect0(Native Method) at java.base/sun.nio.ch.Net.connect(Net.java:589) at java.base/sun.nio.ch.Net.connect(Net.java:596) at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:880) at org.firebirdsql.gds.ng.wire.version10.V10AsynchronousChannel.connect(V10AsynchronousChannel.java:108) ... 7 more

Same error on JAVA. ORACLE UBUNTU ARM64 VPS free tier...

@hvlad
Copy link
Member

hvlad commented Mar 15, 2025

Connection timed out: connect at java.base/sun.nio.ch.Net.connect0(Native Method) at java.base/

Set dedicated port for events conection (RemoteAuxPort in firebird.conf) and make sure it is not blocked by firewall.

@hvlad
Copy link
Member

hvlad commented Mar 15, 2025

mar 14, 2025 6:04:06 P.�M. sur.softsurena.FirebirdEventos.FirebirdEventos registro GRAVE: Error writing data to the connection. [SQLState:08006, ISC error code:335544727] java.sql.SQLException: Error writing data to the connection. [SQLState:08006, ISC error code:335544727] at

Also, this is completely different error than in the first message.

@asfernandes
Copy link
Member

We need complete test case, preferable with ISQL only if Java is not necessary for reproduce.

@Jhironsel
Copy link
Author

databases.conf
Image

My VPS ports.

Image

Server config and firewalls settings.

Image

Image

firebird.log

Image

Image

I don't know how to do....

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

No branches or pull requests

3 participants