Docker blocking when read byte[] in JAVA from external database BLOB

470 / 5000

Resultados de tradução

I’m facing a curious issue in my application. I have an application in JAVA + TOMCAT, which at a certain point reads an image from a database, this image is stored as a BLOB and in JAVA I read it as a byte.
Interestingly at this time my application crashes, it does not go beyond this point and this only occurs when I am with the default network, if I am with network_mode=host this crash does not occur.

The database is external

Anyone can help me to solve this ?

docker-compose

version: '3'

services:
 
  portal:
    image: registry.gitlab.com/XXXXX/containers/XXXXX:latest
    container_name: XXXX
    # network_mode: host
    extra_hosts:
      - "PORTAL_DATABASE:172.16.12.105"
    ports:
      - "8080:8080"
    networks:
      - internet
    
networks:
  internet:
    driver: bridge

Java Code

...
byte[] logo = this.getNamedParameterJdbcTemplate().queryForObject( query.toString(), params, byte[].class );
....

Is this database also run in docker?
I am asking, because the network docker0 uses the cidr 172.16.0.0/16, which if the database is not in a container would indicate a netwowrk colision. A form search for “bip default-address-pools” should yield threads that discuss how to change the default network range.