You could potentially have two instances of a Derby system running on the same machine at the same time. Each instance must run in a different Java Virtual Machine (JVM).
If you use the embedded driver, two separate instances of Derby cannot access the same database. If a Derby instance attempts to access a running database, an error message appears, and a stack trace appears in the derby.log file. If you want more than one Derby instance to be able to access the same database, you can use the Network Server.
If a Derby instance uses the in-memory database capability for its database connection, the database exists only within the JVM of that Derby instance. Another Derby instance could refer to the same database name, but it would not be referring to the same actual database, and no error would result.