Welcome Guest, Not a member yet? Register   Sign In
Transactions using iBase Driver (CI 3.0.4)
#1

Hi Guys, 

I've been working with Firebird 2.5 using ibase DB driver on CI 3.0.4.   I sow that transactions is not working with that driver.   It seems to not rolled back at full the queries between trans_start and trans_complete.  It used to work properly on CI 2.2.0 with firebird driver.

Well, in order to keep my system working I hacked CI 3.0.4 copying the full database folder I have from CI 2.2.0.   So I returned to work with the old dabase driver. 

Is there any solution for this problem ?  Am I doing something wrong ?    I'm CI happy user for 6 years.
Reply
#2

CI 2 doesn't have a firebird driver.
Reply
#3

(This post was last modified: 03-04-2016, 10:50 AM by P.Mendes.)

(03-04-2016, 09:29 AM)Narf Wrote: CI 2 doesn't have a firebird driver.

Not officially.   I'm using a library that I found on the net that works properlly for 6 years.  

I upgraded my CI installation and system just to have a 100% pure CI official instalation.

Can you help me ?   I think there is a bug on the iBase driver.
Reply
#4

(03-04-2016, 10:40 AM)P.Mendes Wrote:
(03-04-2016, 09:29 AM)Narf Wrote: CI 2 doesn't have a firebird driver.

Not officially.   I'm using a library that I found on the net that works properlly for 6 years.  

I upgraded my CI installation and system just to have a 100% pure CI official instalation.

Can you help me ?   I think there is a bug on the iBase driver.

I could take a look at what you claim is working properly and see what the difference between it and CI3's ibase driver is, but I have no way of testing. I'm afraid that as you are the extremely rare case of someone using Firebird, you are the only one who can help.

But CI3 just proxies calls to ibase_trans() and ibase_commit(), ibase_rollback() - the code is dead simple, so the possibility of a bug is highly unlikely.
Reply
#5

(03-04-2016, 11:18 AM)Narf Wrote:
(03-04-2016, 10:40 AM)P.Mendes Wrote:
(03-04-2016, 09:29 AM)Narf Wrote: CI 2 doesn't have a firebird driver.

Not officially.   I'm using a library that I found on the net that works properlly for 6 years.  

I upgraded my CI installation and system just to have a 100% pure CI official instalation.

Can you help me ?   I think there is a bug on the iBase driver.

I could take a look at what you claim is working properly and see what the difference between it and CI3's ibase driver is, but I have no way of testing. I'm afraid that as you are the extremely rare case of someone using Firebird, you are the only one who can help.

But CI3 just proxies calls to ibase_trans() and ibase_commit(), ibase_rollback() - the code is dead simple, so the possibility of a bug is highly unlikely.

Yes, I know that I am a rare case.   I've already tryed to migrate to MySql and PostGre.   MySQL dosn't support my complexes queries and PostGre doesn't have the performance nor the simplicity...  so, I'm still using that not so popular database.   I'll try again in the future.

I sow that the iBase just proxie ibase functions.   

Please take a look at firebird driver I'm using succesfully for years since CI 1.7.2.

Attached Files
.php   firebird_driver.php (Size: 17.89 KB / Downloads: 120)
Reply
#6

I see nothing in there that would make a (desired) difference.

And I also disagree with your comments about MySQL and Postgres, but that's not within our scope here.
Reply
#7

(03-04-2016, 02:00 PM)Narf Wrote: I see nothing in there that would make a (desired) difference.

And I also disagree with your comments about MySQL and Postgres, but that's not within our scope here.

Eventually I found the issue.    We have to use transaction instead of connection on the ibase_query statament in order to have transactions being considered.   You can find the explanations on the ibase php's documentation at the following link http://php.net/manual/en/function.ibase-trans.php

So I changed into ibase_driver.php the following line

return ibase_query($this->conn_id, $sql);

by ...

return ibase_query(isset($this->_ibase_trans) ? $this->_ibase_trans : $this->conn_id, $sql);

Thanks to you to help me Narf !
Reply
#8

Thank you for finding the issue and coming up with the fix.
https://github.com/bcit-ci/CodeIgniter/c...58d6f07e62

However, while in this particular case you really had to modify the system/ dir, I must note that you shouldn't be doing that under normal circumstances.
Reply
#9

I'm happy to contribute and thanks for your support.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB