Bug 431083 - Problem with update/delete in cdo db
Summary: Problem with update/delete in cdo db
Status: NEW
Alias: None
Product: EMF
Classification: Modeling
Component: cdo.db (show other bugs)
Version: 4.13   Edit
Hardware: PC Windows 8
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-25 04:57 EDT by Areq Novak CLA
Modified: 2020-12-11 10:36 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Areq Novak CLA 2014-03-25 04:57:26 EDT
Hi,

I have a problem with update and delete (select works ok)

This code works ok:

String query = "select * from eve_art where cdo_id = '"
+ id + "'";
StandaloneCDOAccess standaloneCDOAccess = new StandaloneCDOAccess();
CDOSession cdoSession = standaloneCDOAccess.openSession();
CDOTransaction transaction = cdoSession.openTransaction();
CDOQuery cqo = transaction.createQuery("sql", query);
EObject object = cqo.getResultValue(clazz);


but this code works wrong (a lack of change in db):

String query = "delete from eve_art where cdo_id = '"
+ uid + "'";
StandaloneCDOAccess standaloneCDOAccess = new StandaloneCDOAccess();
CDOSession cdoSession = standaloneCDOAccess.openSession();
CDOTransaction transaction = cdoSession.openTransaction();
CDOQuery cqo = transaction.createQuery("sql", query);
cqo.setParameter("queryStatement", false);
System.out.println("!! " + cqo.getResult().get(0));

syso returned 1, record still exist in db


init and openSession from StandaloneCDOAccess :

private void init()
{
OMPlatform.INSTANCE.setDebugging(false);
OMPlatform.INSTANCE.addLogHandler(PrintLogHandler.CONSOLE);
OMPlatform.INSTANCE.addTraceHandler(PrintTraceHandler.CONSOLE);

IManagedContainer container = ContainerUtil.createContainer();
Net4jUtil.prepareContainer(container);
TCPUtil.prepareContainer(container);
CDONet4jUtil.prepareContainer(container);
container.activate();

IConnector connector = TCPUtil.getConnector(container, StandaloneCDOServer.DEFAULT_SERVER_ADDRESS);

configuration = CDONet4jUtil.createNet4jSessionConfiguration();
configuration.setConnector(connector);
configuration.setRepositoryName("opencoss");
}


public CDOSession openSession()
{
CDOSession session = configuration.openNet4jSession();

for (EPackage ePackage : getEPackages()) {
session.getPackageRegistry().putEPackage(ePackage);
}

return session;
}

thanks
Mike
Comment 1 Eike Stepper CLA 2015-07-14 02:20:13 EDT
Moving all open bugzillas to 4.5.
Comment 2 Eike Stepper CLA 2016-07-31 01:03:00 EDT
Moving all unaddressed bugzillas to 4.6.
Comment 3 Eike Stepper CLA 2017-12-28 01:20:32 EST
Moving all open bugs to 4.7
Comment 4 Eike Stepper CLA 2019-11-08 02:09:04 EST
Moving all unresolved issues to version 4.8-
Comment 5 Eike Stepper CLA 2019-12-13 12:51:09 EST
Moving all unresolved issues to version 4.9
Comment 6 Eike Stepper CLA 2020-12-11 10:36:22 EST
Moving to 4.13.