Monday, November 30, 2020

What's running in my windows port 8000?

 Tried to start my django, but not able to start it at port 8000.



 Then I run command line netstat -aob | find "8000"

The process was 8252.

Then, went to task manage to find the process ID.


After a little research of what was IP Help. I found that's for IPv6.

So, I decided to kill this process.

Finally, I could restart django again.





Friday, November 13, 2020

SQLite lock

 Looking at the node.js sequelize sample : https://github.com/mirkojotic/node-sequelize-article/blob/master/index.js

In this code, I use sqlite for just simple playing around.

const sequelize = new Sequelize({
  dialect: 'sqlite',
  storage: './database.sqlite'
}); 

 

Unfortunately,  data table will be locked when continue insert data in the same table.

    const tags = body.tags.map(
        tag =>
            Tag.findOrCreate({
                where: { name: tag.name },
                defaults: { name: tag.name }
            }).spread(
                (tagcreated=> tag
            )

    );


The error could be one of the two following messages:

Unhandled rejection SequelizeDatabaseError: SQLITE_ERROR: cannot start a transaction within a transaction


Unhandled rejection SequelizeTimeoutError: SQLITE_BUSY: database is locked

The sqlite is in memory database, so it has fast transaction.

I don't face this kind of issue, when I was working on python django.

So, mostly I realize think this is node.js sqlite module implementation issue.