gra-m / DBServer

Database server project
0 stars 0 forks source link

Implement Transaction Class #28

Closed gra-m closed 2 years ago

gra-m commented 2 years ago

    private Map<Long, ITransaction> transactions;

@Override
    public ITransaction beginTransaction() {
        long threadId = Thread.currentThread().getId(); // If we know the thread id we can store the transaction
        ITransaction transaction = new Transaction();
        this.transactions.put(threadId, transaction); // now DB knows which transactions belong to this thread.. but if multiple wont work.
        return new Transaction();
    } ```