Transactions with MySQL?
Hi,
I would like to know if BC4J supports transactions even with a database, like MySQl, that supports no transactions. Are there any drawbacks, when using the transaction functionality with such a database?
thanks for your help
Benjamin
This issue is solved in 4.0EA3.
Similar Messages
-
About using hibernate with mysql
hi all,
i have used hibernate with hsqldb(database given by default) and it works fine.but when i tried to use it with mysql then i have encountered a problem
xception
org.hibernate.TransactionException: Transaction not successfully started
org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:149)
events.EventManagerServlet.doGet(EventManagerServlet.java:63)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
though i have put jar file of mysql in lib directory and changed the driver name in hibernate.cfg.xml.
can any one place some example illustrating the steps involving.thanxHi smogura,
Thanks for the message. Ok I did as you told. I believe I went to the right place:
Resource->JDBC Connection pools. However I wasn't sure how exactly to go about setting connection pools,
so I went to the web and did a search and I managed to get hold of this
website:http://www.albeesonline.com/blog/2008/08/06/creating-and-configuring-a-mysql-datasource-in-
glassfish-application-server/
I followed from steps 4 onwards. However at step 14, I did not get a sucesfull ping. The values I used are as follows:
General:
Name: MySQL
Datasource Classname: com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
Resource Type: javax.sql.ConnectionPoolDataSource
Advanced Properties:
databaseName: ebooking
ServerName: GlassFish
URL jdbc:mysql://localhost:3306/ebooking
password *****
user: 1234
I am not sure what is wrong, by the way, I am using Glassfish V3 that comes bundled with netbeans. Any idea what's wrong or missing? Thanks
regards -
Reconnect policy with MySQL failing because of autoCommit error
This related to this issue, but I didn't see any responses to it: Reconnecting a dead connection from a UnitOfWork commit - Autocommit error
I'm testing with MySQL 4.1 and I have a reconnect policy that does the following (I believe this is a pretty standard approach):
session.setExceptionHandler( new ExceptionHandler() {
public Object handleException(RuntimeException exception) {
if (exception instanceof DatabaseException) {
dbex.getAccessor().reestablishConnection(dbex.getSession());
However, when it reestablishes the connection (and I have traced this and can verify that this code is executing and a reconnect is performed), I get the following error for any updates:
Internal Exception: java.sql.SQLException: Can't call rollback when autocommit=trueError Code: 0
at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:277)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicRollbackTransaction(DatabaseAccessor.java:1090)
at oracle.toplink.internal.databaseaccess.DatasourceAccessor.rollbackTransaction(DatasourceAccessor.java:486)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.rollbackTransaction(DatabaseAccessor.java:1075)
at oracle.toplink.publicinterface.Session.basicRollbackTransaction(Session.java:377)
I only have this problem with the MySQL JDBC drivers. I can continue to read normally, but I can't perform any transactions.
This isn't so much of a question about MySQL specifically, but rather a question about how reestablishConnection() connects to the database differently from my initial login using DatabaseLogin. Obviously, I don't have this error connecting normally. I only get it after a reconnect is applied.
Specific questions are: Is there another handler I can add to ensure JDBC Connections returned by ServerSession are always setAutoCommit(false)? Am I reestablishing the JDBC connections incorrectly?
NateNate,
This does appear to be MySQL JDBC specific but is most likely related to a general issue.
When the connection drops and you receive the notification through the exception handler I would typically recommend looking at the session in us (isUnitOfWork) or the query type (isWriteObjectQuery) to see if the operation that failed was involved in a transaction (UnitOfWork commit).
In these transaction cases you need to do more then just re-connect and retry. You need to ensure after reconnection that an application exception is raised so the UnitOfWork operation(s) can be retried completely. I would simply add to this case to ensure that the JDBC connection is put back in a state where it can be managed properly.
There is no special operation or any case I know of where any special auto-commit needs to be set on a connection after it has dropped and before it is re-connected.
Doug -
hello everyone,
can we anyone help me with small example, how to connect j2me with mysql.Put all your Database transactions in server side, using Connection framework in J2ME, access that URL by your device. Here is a snap to access a URL to get the message returned by that URL.
public String getMessage(String url)
HttpConnection hc = (HttpConnection)Connector.open( url, Connector.READ_WRITE );
hc.setRequestMethod( HttpConnection.POST );
InputStream in=hc.openInputStream();
DataInputStream dis=new DataInputStream(in);
int ch;
String msg="";
while((ch=dis.read())!= -1)
msg=""+msg+(char)ch;
reutrn msg;
} -
Doing transactions with MyISAM tables
On Feb. 24, a question was asked about using cftransaction
with MySQL. That person's answer was to convert the tables to
InnoDB.
I have three tables that must stay "in lockstep". When I add
a row to one table, I have to add rows to the other two. If they
get out of sync, one of the queries runs excruciatingly slow.
I tried wrapping them in a cftransaction, but now find out
that it didn't really do any good because the table format is still
MyISAM. Is there anything I can do (short of altering the tables)
to do transactions?
Is there a way to get MySQL to process the transactions
"manually". Do I have to do a series of "trys" and "catches" with a
commit or rollback for each one? Do you know of a place where I can
see code like that?
It would be nice if I were just missing something and someone
could tell me how to do transactions with MyISAM tables. But, I'll
do whatever is necessary to avoid having the tables get out of
sync.
Thanks.After making a copy of the tables:
I used MySQLAdmin to convert each of the tables to InnoDB. It
displayed the correct "alter table table_name type=innobd;" box
before each change.
Before the changes, the three tables showed the same record
count. After the changes, they were wildly different. But, (with no
changes to the web pages) the application opens OK and I can call
up records. Did the conversion get rid of some records or what?
Also, one of the pages (that uses a lot of convoluted logic
for the display) takes a lot longer to appear than it used to. All
the other pages are open fine and display their forms, etc..
Updates seem a little slower, but not too bad.
Why is the record count different in the three tables? Why
might the one page be running slower? (Do I need to make any
changes in the original web page code?)
Prior to the conversion, the three MyISAM tables (*.MYD,
*.MYI, & *.frm) were all stored in the C:\\Program
Files\MySQL\MySQL Server 5.0\data\my_data directory. Now that
directory only holds ".frm" files. Where did the conversion put the
new tables?
I haven't yet tested the cftransactions to verify they work.
That's next.
Thanks. -
Create transaction with variant not working
Hello!
Here's my issue -- I have a program that, right now, is more of a shell than anything else. It is to access the HR Logical Database PNPCE, and to help filter the data I pull back, I created a Selection View with a couple of additional fields. I put the necessary values in these fields and saved it as a Variant.
All I want to do is create a transaction to run my program and start it using my Variant to fill in these additional fields. Using SE93, I can create a plain transaction with no problem. However, if I click the "Start with variant" drop-down field, I get a response that says screen 1000 (my default Selection Screen) has no variants.
At first we thought there was some client-side things needing configuration, but if I go create a quick-and-dirty program with a single Selection Screen value (no Selection View) and a Variant, SE93 sees the variant with no problems. So I'm wondering if maybe it has something to do with the fact that I'm using a Selection View. Unfortunately, I'm so new to ABAP, I'm completely stuck on how to proceed.
Any suggestions? Thank you so much!Saquib, thank you SO much! You're right -- that worked.
As a relative newbie to SAP R/3 and ABAP, I'm new to little quirks like this. In other examples, the list (F4) does show the variants. For some reason, this one didn't. I entered it anyway, saved, and ran the transaction, and it popped up with the fields populated from the variant.
Again, kudos and thank you so much. Points duly awarded. -
OBIEE 11G with MySql Issue Hierarchy is not working..
Hi,
i am using the OBIEE 11G with MySQL DB. i have sucessfully created the RPD. i created the Hierarchy in the RPD. this is the scerario i have created.
i have only one data column created_at. by using this column i create 3 more logical logical columns, which are Year,Month Name,Week and created Hierarchy by taking the these columns only.
when i am viewing the result by taking the hierarchy it throwing the error systax error"ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version".
but we selecting the year column it successfully nagvigating to the month level data but when selecting the Hierarchy directly it is unable to navigate from year to month.
please provide me the solution for this as soon as possbile i have an urgent requirement on this.
Thanks,
Yogi.Hi,
Thanks for you post..
My Requriement is that we no need to create new columns we need to necessary columns in BMM layer only and we need to use them in Hierarchy.
Thanks,
Yogi. -
Posting of cross company transaction with different doc types
Hi,
The scenario is:-
We have two companies X and Y.
X makes a payment to Y with the following FI entries:-
Company Code X
Dr Vendor Y
Cr Bank HDFC
Company Code Y
Dr Bank ICICI
Cr Customer X
Now this needs to be a cross company transaction where the doc type for CC X should be vendor Payment 'KZ' while the doc type for CC Y should be a customer reciept with doc type 'DZ'.
Although I am able to map the accounts in cross company code config I am not able to split the transaction of different company codes with different document types.
Is there any way we can do this in standard SAP?
Thanks in advance,
NitishHi
As per your issue ...There are no possibilities to post in sap with different document types.
If you want you can post cross company code transactions with one document types
Regards
vamsi -
You cannot reconcile a/p invoice transaction with A/P Down Payment request manually
Dear Experts,
One of my client has facing this problem while doing Reconciliation then he is getting the following error.
"you cannot reconcile a/p invoice transaction with A/P Down Payment request manually"
then we found a solution in SAP Forums and applied the same in Test Company Environment, then its working good and also attaching the scenario with screen shot.
Please have a look into the attachment then tell us. Is it a good practice to proceed or is there any solution as simple as this.
One more thing is my client has having more 20000 records to do reconciliation and he is looking for any alternative solution.
So please tell us a Better solution.
We are awaiting for your prompt response.....Hi,
Please check SAP note:
1340606 - Paid Down Payment Request cannot be reconciled
internally.
Thanks & Regards,
Nagarajan -
Skip first screen of BD87 using call transaction with BDC_DATA option
hello all,
i am using call transaction with BDC_DATA option and i want to skip first screen, so can anyone please tell me how can i skip first screen of BD87 and get second screen that is output screen?
regards.Hi
Build a BDCDATA with following code..
T BD87
RBDMON00 1100 X
BDC_CURSOR SX_DOCNU-LOW
BDC_OKCODE =CRET
SX_DOCNU-LOW
SX_CRETI-LOW 00:00:00
SX_CRETI-HIGH 00:00:00
SX_UPDDA-LOW 05.02.2010
SX_UPDDA-HIGH 05.02.2010
SX_UPDTI-LOW 00:00:00
SX_UPDTI-HIGH 00:00:00
RBDMON00 0100 X
BDC_OKCODE =BACK
RBDMON00 1100 X
BDC_OKCODE /ECBAC
BDC_CURSOR SX_DOCNU-LOW -
Can' t connect Java with MySQL
My goal is to connect Java with MySQL. I found many solutions on Internet, but I always get the same mistake:
SQLException: No suitable driver
SQLState: 08001
VendorError: 0MySQL works fine alone or with php.Only thing left me to think is that the installed versions are not compatible for this mysql-connector-java-5.0.4
I don't believe that could be a reason.
Installed versions are:
Apache Tomcat 5.5.20 Server
Apache HTTP Server 2.2.4
PHP 5.2.0
MySQL 5.2
jre 1.5.0_11
jdk1.5.0_11
Apache Tomacat JK2 connector Version: 1.2.20 File Name: mod_jk-apache-2.2.3.so
mysql-connector-java-5.0.4
I also set connector in class path: C:\mysql-connector-java-5.0.4;C:\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\mysql-connector-java-5.0.4\src\com\mysql\jdbc
For installation I used manulas from:
http://apacheguide.org/jsp.php
http://doc.51windows.net/mysql/?url=/MySQL/ch23s03.html
Here is also a test code in java:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Connect
public static void main (String[] args)
Connection conn = null;
try {
conn =
DriverManager.getConnection("jdbc:mysql://localhost/first_test" +
"user=monty&password=greatsqldb");
// Do something with the Connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}i'm desperate, please help or tell me someone who'll know the answer.
Thank You in advancehey buddy .. it seems yr code is wrong .. in getconnection () method u should also specify the port ,which u r not doing ...
the default port for MySQL is 3306 ... see below i am giving you a sample code ... its working fine .. and dont forget to put the MySQL driver jar path in to classpath and also copy the jar into common/lib folder of your tomcat ....
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MySQLConnectionTest {
public static void main(String[] args) {
new MySQLConnectionTest().connTest();
public void connTest() {
String tableName = "portfolio"; //change as per setting
String hostName = "10.81.9.39"; // please change for the target database ip or hostname
String dbPort = "3306"; //change if not using the default
String dbName = "tradingsystem"; //change as per the given DB name
String username = "root"; //change as per setting
String password = "password"; //change as per setting
System.out.println("before try");
Double data=0.0;
Double data1=0.0;
try {
Class.forName("org.gjt.mm.mysql.Driver");
System.out.println("before driver manager");
Connection conn = DriverManager.getConnection("jdbc:mysql://"+hostName+":"+dbPort+"/"+dbName, username, password);
String query1 = "select * from "+tableName+" where User_id='trader1' and Stock_Type='Equity'";
System.out.println("quesry1="+query1);
Statement stmt = conn.createStatement();
ResultSet rs1 = stmt.executeQuery(query1);
while(rs1.next())
System.out.println("hiiiiii for rs1");
System.out.println(rs1);
Quantity=(Integer)rs1.getObject(5);
MarketPrice=(Double) rs1.getObject(8);
data=Quantity*MarketPrice;
data1+=data;
System.out.println("data1="+data1);
i=0;
rs1.close();
stmt.close();
conn.close();
} catch (ClassNotFoundException e) {
e.printStackTrace(System.err);
} catch (SQLException e) {
e.printStackTrace(System.err);
i hope it will work for u...
cheers, -
JDeveloper 10.1.2 with MySQL and PostgreSQL
I'm testing JDeveloper 10.1.2 business components with mysql or postgresql because my company needs to connect also to these non-oracle DBs. ADF suits our developement needs, in speed and functionalities; anyway to make it our main developement system we need it to be compatible.
I made three tests and they were all disappointing.
At first, I installed MySQL 4.0 on my windows machine. I used the stable Connector/J 3.1
and then MySQL Connector/J 3.0, but in both cases JDeveloper had a strange behaviour: I can make the connection, I can navigate correctly through all tables in the connection-navigator, I see all the column names etc... Anyway, as I try to build a "new Entity Object" from a table, there are no available table properties, like if the table had no columns.
In this forum I only found documentation about rowid problems with mysql, but nothing about Entity Object wizard issues.
Then I switched to PostgreSQL. I installed it locally, so I had to choose the 8.01 since I'm on a windows machine. JDBC driver: postgresql-8.0-310 jdbc3
The developement test phase went ok, it is possible to use this DB just as if it was a Oracle, all the business components wizards works perfectly.
The problem is at runtime, unfortunately. I built a simple datapage on the struts-config diagram and I dragged on it a "read-only table" from the data control palette.
As I run the application, the embedded OC4J immediately returns this error:
oracle.jbo.JboException: JBO-29000: JBO-29000: JBO-29000: JBO-26061: Errore durante lapertura della connessione JDBC.
at oracle.jbo.JboException.<init>(JboException.java:343)
(in english: Error during JDBC connection)
There are no other available JDBC drivers for JVM 1.4x so I see no solution...
I also tried to connect to an older PostgresSQL with its (older) JDBC but I get same the result.
Anyone can help? Is it a JDev 10.1.2 issue?Hi Paolo.
I'm also doing such tests.
I did not ran into these problems because I created the busisness componentes using an Oracle connection first.
After that, I switched the datatype of the table columns in the entity object to meet the SQL92 criteria ( like changing NUMBER(n) to INTEGER ).
And then, I switched the connection to the postgreSQL or MySQL. This worked fine for me.
But, the other big problem you will face is related to updating records using postgreSQL connection.
Please see my post "Problem updating records using BC4J with foreign data sources" Problem updating records using BC4J with foreign data sources
It would by fine if we help each other to solve this problems.
Thanks
Denis -
No authorization for this transaction with movement type 601
Dear All,
This is chandra i am getting this error in delivery level " No authorization for this transaction with movement type 601. If give the authorization for SAP ALL its working fine. If give the authorization for SAP SD T.Codes i am getting this error. Plz help me.
Thanks and regards
ChandraDear Chandra,
Check with -
T. Code: OMJJ
Select Movement Type: 601 and Double-Click: "Allowed Transaction" (From Left-hand side) .
Check whether the Transaction is allowed for Movement Type 601 or not
Note: if Transaction is not listed (i.e. not allowed) and you wanna allow this Transaction with Movement type 601, then -
Up-there, Tab: New Entry. Click on it.
Maintain entry as:
MovTy: 601
TCode: As reqd.
and Save.
Best Regards,
Amit -
i am using JSP in Linux Platform. when i connected to mysql with mysql driver for odbc by using the following code,
import java.sql.*;
public class TestMysql
public static void main(String args[]) {
try {
Connection con;
String connStr = "jdbc:mysql://localhost/test?user=root&password=mysql";
Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
System.out.println("OK");
con = DriverManager.getConnection( connStr );
System.out.println("Again OK");
catch( Exception x )
x.printStackTrace();
i got the following exception
OK
java.sql.SQLException: Error during query: Unexpected Exception: java.io.CharConversionException message given: null
Nested Stack Trace:
** BEGIN NESTED EXCEPTION **
java.io.CharConversionException
STACKTRACE:
java.io.CharConversionException
at gnu.gcj.convert.Input_iconv.read(char[], int, int) (/usr/lib/libgcj.so.5.0.0)
at java.lang.String.init(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at java.lang.String.String(byte[], int, int, java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at com.mysql.jdbc.SingleByteCharsetConverter.SingleByteCharsetConverter(java.lang.String) (Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.initCharset(java.lang.String) (Unknown Source)
at com.mysql.jdbc.SingleByteCharsetConverter.getInstance(java.lang.String, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.Connection.getCharsetConverter(java.lang.String) (Unknown Source)
at com.mysql.jdbc.StringUtils.getBytes(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.Buffer.writeStringNoNull(java.lang.String, java.lang.String, java.lang.String, boolean, com.mysql.jdbc.Connection) (Unknown Source)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(com.mysql.jdbc.Statement, java.lang.String, java.lang.String, com.mysql.jdbc.Buffer, int, com.mysql.jdbc.Connection, int, int, boolean, java.lang.String, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at TestMysql.main(java.lang.String[]) (Unknown Source)
** END NESTED EXCEPTION **
at com.mysql.jdbc.Connection.execSQL(com.mysql.jdbc.Statement, java.lang.String, int, com.mysql.jdbc.Buffer, int, int, boolean, java.lang.String, boolean, boolean) (Unknown Source)
at com.mysql.jdbc.Connection.configureClientCharacterSet() (Unknown Source)
at com.mysql.jdbc.Connection.initializePropsFromServer() (Unknown Source)
at com.mysql.jdbc.Connection.createNewIO(boolean) (Unknown Source)
at com.mysql.jdbc.Connection.Connection(java.lang.String, int, java.util.Properties, java.lang.String, java.lang.String) (Unknown Source)
at com.mysql.jdbc.NonRegisteringDriver.connect(java.lang.String, java.util.Properties) (Unknown Source)
at java.sql.DriverManager.getConnection(java.lang.String, java.util.Properties) (/usr/lib/libgcj.so.5.0.0)
at java.sql.DriverManager.getConnection(java.lang.String) (/usr/lib/libgcj.so.5.0.0)
at TestMysql.main(java.lang.String[]) (Unknown Source)
i have the database, hello.
The same code works well in Windows, But in Linux, the above exception.
By using the username root and password mysql , i can connect to mysql directly from the mysql prompt.
Pls help me..
I have already put the query 'access denied problem in Mysql' some day before. from the reply, i made some changes in user table(ie. set the password for [email protected].).After this change, this new Exception came..
The structure of my mysql.user table is
# host user password
1 localhost root 68d4f47c49a579c9
2 localhost.localdomain root 68d4f47c49a579c9
3 localhost.localdomain
4 localhost
Pls help me.
Edited by: SUMESHBABU_R on Sep 30, 2007 11:36 PMWell, at least the trace tells me that this issue is to be tracked back to the core of the MySQL JDBC driver and the Linux's implementation of JVM. It might be worth the effort to post this issue at their website/forum/issuetracker. It might also be worth the effort to tryout the newer MySQL JDBC driver 5.1, as it is written specific for JDK 6.0 (while MySQL JDBC driver 5.0 is targeted at JDK 5.0).
-
Setting up testing server with MySQL
I am just migrating to the MacBook from an older iMac G5. I was running PHP with MySQL 4.1.15. I just downloaded the PHP 5.2.2 and need to know which version of MySQL will run with it on my MacBook. Any help, please, especially if you are using Dreamweaver and have migrated to CS3. Thanks, Jay
Hi
I am successfully running MySQL 5.0.37 with PHP 5.2.1. (I don't use Dreamweaver or CS3 though.)
Matt
Maybe you are looking for
-
Maximum file size for iDisk's public folder?
I was wondering whether there is a max size for files in the idisk's public folder. When syncing my 68 MB zip file, the file on the iDisk shows 0MB. When uploading files externally via Safari, any file above 1 MB shows as 0MB. What are the restrictio
-
How to use a Flash/Flex GUI for DW Extensions
I am creating a DW extension for an image and flash gallery. The extension will be accessible from the Insert menu. Once clicked, it would present me with a Flash/Flex form to search/browse for images/swf by file name or tags. Once I select an image/
-
Time Capsule + MacBook Pro
So i got a MBP and set it up last night. also got the time capsule and configured it. It seemed to be working, my Dell laptop recognized the wireless network and connected. But my Mac was not configured for that network (when i booted up, i configure
-
The update shows up in the list, but always fails to download. I'm also finding that the Realtek card reader driver doesn't get detected. I'm using SCCM and just downloaded those drivers manually and apply them in a different section of the task se
-
Interactive report PDF download
Hi, PDF output is not proper when interactive report is having more number of columns. I have a interactive report with 40 columns. I tried to change Page attributes in print attributes tab. But there is no change. Please tell me what setups to be do